Say the HTML is this
<div id="mydiv" style="border:10px solid #ff0000;">Hello World</div>
then you get the width of the border with this:
var borderWidth =($("#mydiv").outerWidth() - $("#mydiv").width()) / 2;
Say the HTML is this
<div id="mydiv" style="border:10px solid #ff0000;">Hello World</div>
then you get the width of the border with this:
var borderWidth =($("#mydiv").outerWidth() - $("#mydiv").width()) / 2;