Return the width of the outline of a <div> element:
alert(document.getElementById("myDiv").style.outlineWidth);
<!DOCTYPE html> <html> <head> <style> #myDiv {/*from ww w . jav a2s .co m*/ border: 1px solid red; outline: dotted green; } </style> </head> <body> <div id="myDiv" style="outline-width:10px;">This is a div element.</div> <br> <button type="button" onclick="myFunction()">Return outline width</button> <p id="demo"></p> <script> function myFunction() { document.getElementById("demo").innerHTML = document.getElementById("myDiv").style.outlineWidth; } </script> </body> </html>