Reputation: 24666
After several attempts using width()
, outerWidth()
and css("width)
I discovered that all of these methods return a calculated value (in my case always different from the original value), so how can I read the value I set for element width
in my css?
Upvotes: 1
Views: 207
Reputation: 121998
Try OuterWidth
$('#target').outerWidth(true);
the padding and border are included in the calculation; if you pass true, the margin is also included.
Upvotes: 1