Return the border property values of a <div> element:
alert(document.getElementById("myDiv").style.border);
<!DOCTYPE html> <html> <body> <div id="myDiv" style="border:1px solid red;">This is a div element.</div> <br> <button type="button" onclick="myFunction()">Return border</button> <p id="demo"></p> <script> function myFunction() {/* w w w.j a va 2s . c o m*/ document.getElementById("demo").innerHTML = document.getElementById("myDiv").style.border; } </script> </body> </html>