[Javascript] help

Peter Brunone peter at brunone.com
Mon Feb 3 09:45:11 CST 2003


Alex,

	I think it would be better to use the object model of the SELECT itself,
like this:

document.forms[0].parentSelect.options[0].text = "opval";

where options[0] is whatever index you choose for the current value.  You
will want to assign a name attribute as well as an id attribute, like this:

<select id='parentSelect' name='parentSelect'>

and make sure the entire structure is inside a form.

Cheers,

Peter

|-----Original Message-----
|From: javascript-admin at LaTech.edu [mailto:javascript-admin at LaTech.edu]On
|Behalf Of Alex Benitez
|Sent: Monday, February 03, 2003 9:18 AM
|To: javascript at LaTech.edu
|Subject: [Javascript] help
|
|
|
|
|example:  <select id='parentSelect'></select>
|
|then later i call parentSelect.innerHTML = "<option>opval</option>"
|
|what actually ends up in that property is "opval</option>"
|_______________________________________________
|Javascript mailing list
|Javascript at LaTech.edu
|https://lists.LaTech.edu/mailman/listinfo/javascript
|




More information about the Javascript mailing list