How do I find the width of an element?
I have maxwidth set to 100px & width set to “auto”. I’m attempting to find its exact width dynamically which could be <100px.
I tried these options:
element.offSetWidth, element.style.width, created a region through Dom.getRegion & pulled width..
However, all the above options return 100px as width.
Any non-jquery based solution please?
-Vidi
offsetWidthreally should work. Proof. Try resizing the “Result” window, and you’ll see thedivupdate in size.Make sure you use
offsetWidth, notoffSetWidth(note capitalization).