Change the width of the four borders of a <div> element, using the length value:
document.getElementById("myDiv").style.borderWidth = "1px 5px 10px 20px";
<!DOCTYPE html> <html> <head> <style> #myDiv {/*from w ww . j a va 2s . co m*/ border-style: solid; } </style> </head> <body> <div id="myDiv">This is a div element.</div> <br> <button type="button" onclick="myFunction()">Change width of the four borders</button> <script> function myFunction() { document.getElementById("myDiv").style.borderWidth = "1px 5px 10px 20px"; } </script> </body> </html>