I want this javascript to create options from 12 to 100 in a select with id=\"mainSelect\", because I do not want to create all of the option tags manually. Can you give me
When you create a new Option
object, there are two parameters to pass: The first is the text you want to
appear in the list, and the second the value to be assigned to the option.
var myNewOption = new Option("TheText", "TheValue");
You then simply assign this Option
object to an empty array element, for example:
document.theForm.theSelectObject.options[0] = myNewOption;