Return the border color of a <div> element:
alert(document.getElementById("myDiv").style.outlineColor);
<!DOCTYPE html> <html> <head> <style> #myDiv {/*w w w . j a v a 2s .com*/ border: 1px solid red; outline-style: dotted; } </style> </head> <body> <div id="myDiv" style="outline-color:blue;">This is a div element.</div> <br> <button type="button" onclick="myFunction()">Return outline color</button> <p id="demo"></p> <script> function myFunction() { document.getElementById("demo").innerHTML = document.getElementById("myDiv").style.outlineColor; } </script> </body> </html>