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

Javascript examples for CSS Style Property:borderRight

Description

Get the border-right property values of a <div> element:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

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

<script>
function myFunction() {/*  w  w w  .ja  v  a2s .  c  o m*/
    console.log(document.getElementById("myDiv").style.borderRight);
}
</script>

</body>
</html>

Related Tutorials