Javascript DOM CSS Style borderBottomWidth Property get

Introduction

Return the width of the bottom border of a <div> element:

alert(document.getElementById("myDiv").style.borderBottomWidth);

View in separate window

<!DOCTYPE html>
<html>
<body>

<div id="myDiv" style="border-bottom:thick solid red">This is a div element.</div>
<br>
<button type="button" onclick="myFunction()">Return the width of the bottom border</button>

<p id="demo"></p>
<script>
function myFunction() {/*from  w w w  .  ja v a  2 s . c  om*/
  
document.getElementById("demo").innerHTML = document.getElementById("myDiv").style.borderBottomWidth;
}
</script>

</body>
</html>



PreviousNext

Related