...

View Full Version : getting ACTUAL width of a select box



voxecho
03-22-2007, 03:48 PM
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?

shyam
03-22-2007, 11:18 PM
o.style.offsetWidth

david_kw
03-22-2007, 11:32 PM
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

shyam
03-26-2007, 06:50 PM
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

voxecho
06-15-2007, 05:30 PM
i forgot to answer this...

thanks all, it worked out fine :-D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum