Return the left border style of a <div> element:
alert(document.getElementById("myDiv").style.borderLeftStyle);
<!DOCTYPE html> <html> <body> <div id="myDiv" style="border-left:double;">This is a div.</div> <br> <button type="button" onclick="myFunction()">Return left border style</button> <p id="demo"></p> <script> function myFunction() {//www . j av a 2s . c o m document.getElementById("demo").innerHTML = document.getElementById("myDiv").style.borderLeftStyle; } </script> </body> </html>