Javascript examples for CSS Style Property:borderTopWidth
Get the width of the top border of a <div> element:
<!DOCTYPE html> <html> <body> <div id="myDiv" style="border-top:thick solid red">This is a div element.</div> <br> <button type="button" onclick="myFunction()">Return the width of the top border</button> <script> function myFunction() {/* w w w. ja v a2 s . co m*/ console.log(document.getElementById("myDiv").style.borderTopWidth); } </script> </body> </html>