How can I compute the exact width of a block element excluding padding, scroll bar, border, and margin? I know I can use $(element).width()
, but jQuery does not compute the exact value because it silently rounds up the fractional part. (Please see my previous question here.)
The only way I can think of is to use .getBoundingClientRect().width
and subtract what's not needed. There's got to be something better than this, but what is it?