Javascript examples for CSS Style Property:borderWidth
Get the width of the border of a <div> element:
<!DOCTYPE html> <html> <body> <div id="myDiv" style="border:1px solid black">This is a div element.</div> <br> <button type="button" onclick="myFunction()">Return the width of the border</button> <script> function myFunction() {//from w ww . j av a2 s . c o m console.log(document.getElementById("myDiv").style.borderWidth); } </script> </body> </html>