[thelist] [DOM] Dynamically adding an OPTION to SELECT - funky IE vs Gecko...

Tom Dell'Aringa pixelmech at yahoo.com
Tue Mar 16 06:50:35 CST 2004


--- Kasimir K <mail at kasimir-k.fi> wrote:
> use:
> newSelect.appendChild(option);
> 
> then instead of this :
> option.text = arrayOptions[1][i];

That works great and was what I wanted.

> you may also want to use:
> option.appendChild(document.createTextNode(arrayOptions[1][i]));

This of course also works. However, this is only the TEXT value of
the option. Is there a DOM way to append the VALUE? Need to set a
value or the form element isn't going to work. I have no problem
using the object.propety way to do it because it works but just
curious.

Tom


=====
http://www.Pixelmech.com/ - read my latest blog posting!
http://www.DMXzone.com/ - JavaScript Author
http://SparklesParties.com - Princess parties for little girls!
http://www.thywordistruth.net/ - Eternal Life

"Well, my name's Dewey Oxburger. My friends call me Ox. I dont know if you've noticed, but I got a slight weight problem."





More information about the thelist mailing list