Return the border-right property values of a <div> element:
alert(document.getElementById("myDiv").style.borderLeft);
<!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> <p id="demo"></p> <script> function myFunction() {//from w w w . ja v a 2 s . co m document.getElementById("demo").innerHTML = document.getElementById("myDiv").style.borderRight; } </script> </body> </html>