[thelist] pass by value in JavaScript?

David Bindel dbindel at austin.rr.com
Thu Apr 25 17:02:01 CDT 2002


At 11:37 25/04/02 -0400, you wrote:

>>> form.select1.options[0] = new Option(form.select2.options[0].text,
form.select2.options[0].value);
>>> What does this line do???

That line of JavaScript would set the first option in the drop-down menu
named "select1" to the name/value of the first option in another
drop-down menu called "select2".

Here is the syntax for that command:

	new Option(text, value);

Where text is the actual text you see in the menu and value is the value
that is passed to a script when that form is submitted.


David Bindel




More information about the thelist mailing list