How to get element width in pixels (px)? jQuery always returns value in percent (pct).
HTML
From the jQuery documentation on width()
The difference between .css(width) and .width() is that the latter returns a unit-less pixel value (for example, 400) while the former returns a value with units intact (for example, 400px). The .width() method is recommended when an element's width needs to be used in a mathematical calculation.
So it returns pixels if the pixel width is defined, but you are defining the width in %