Javascript DOM CSS Style borderRightWidth Property get

Introduction

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

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

View 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>

<p id="demo"></p>


<script>
function myFunction() {//from w w  w .  j a v  a 2  s. co  m
  document.getElementById("demo").innerHTML = document.getElementById("myDiv").style.borderRightWidth;
}
</script>

</body>
</html>



PreviousNext

Related