Helpful Information
 
 
Category: Ajax and Design
getting ACTUAL width of a select box

is there any way to find out what the "physical" width of a select is. o.style.width only returns the value set with css, i would like to know what width occures when you don't set a style (ie. allow the browser to size based on content)

is this possible?

o.style.offsetWidth

I think it might be outside the style object like

o.offsetWidth

although I've never used it myself. It could be browser dependent too I suppose.

david_kw

Kor is right offsetWidth isn't a style attribute.. (Thanks for catching that Kor :))...offsetWidth is supported by both IE and mozilla http://www.quirksmode.org/dom/getstyles.html

i forgot to answer this...

thanks all, it worked out fine :-D










privacy (GDPR)