Ticket #10595 (closed bug: invalid)
Selectbox width() and css('width') discrepancies
|Reported by:||Adam||Owned by:|
See JS fiddle at: http://jsfiddle.net/8MW4u/3/
CSS: width: 100px border: 1px padding: 5px
The jQuery width() method incorrectly subtracts the borders width (2px) of a 100px width selectbox in Chrome, reporting the width as 98px instead. This does not happen with an input field of type text with the exact same CSS.
In Firefox the discrepancy is even worse, since there the padding is also subtracted, reporting a width of 88px. Again, for a text input everything works fine.
The exact same problem occurs with css('width'), which reports the same values.
Why are the reported widths of a selectbox not consistent with the reported widths of a text input? And why not cross-browser consistent at least?