View Full Version : getting ACTUAL width of a select box
voxecho
03-22-2007, 04: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-23-2007, 12:18 AM
o.style.offsetWidth
david_kw
03-23-2007, 12:32 AM
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, 07: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, 06:30 PM
i forgot to answer this...
thanks all, it worked out fine :-D
vBulletin® v3.8.2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.