offsetWidth
isn't good enough for me right now, as this includes padding and border width. I want to find out the content width of the element. Is there a property for that, or do I have to take the offsetWidth and then subtract the padding and border width from the computed style?
I would suggest either scrollWidth
or the clientWidth
depending on whether you want to account for the scrollbar.
Check out Determining the dimensions of elements or the specification itself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With