Get the width of the right border of a <div> element: - Javascript CSS Style Property

Javascript examples for CSS Style Property:borderRightWidth

Description

Get the width of the right border of a <div> element:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

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

<script>
function myFunction() {/*  w ww  .  j a  v  a 2  s  .  c  o m*/
    console.log(document.getElementById("myDiv").style.borderRightWidth);
}
</script>

</body>
</html>

Related Tutorials