I would like to get, in my JS code, the "original" CSS width property applied to an element, not the runtime (computed) width.
eg.
.foo {
width: 50% /* or 123px, or 5em, ...*/
}
in this case, I want to get "50%"
, and not the px value computed at runtime. If value is given in em, I want to get em as result.
window.getComputedStyle(foo, null).getPropertyValue('width')
, returns a pixel value (at least on google chrome).
In fact I need the text value of the CSS rule applied to the element.