Get border width from a div with plain javascript

I got this style applied to a div

div#content {
border: 1px solid skyblue;  
}

and i want to be able to alert the width of the border, I have tried with this:

window.alert( document.getElementById( "content" ).style.borderWidth );

I heard that depends of the browser maybe you can help me
I’m using Firefox 18

49 thoughts on “Get border width from a div with plain javascript”

Leave a Comment