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?
1 Answer
Try OuterWidth
$('#target').outerWidth(true);
the padding and border are included in the calculation; if you pass true, the margin is also included.
1 Comment
davioooh
This is not working for me. It returns a greater value also specifying
includeMargin=true. So I'd like to read the value directly from my CSS...
paddingset. so get the value of padding aswell