PDA

View Full Version : Dynamic select



REdefined
February 26th, 2004, 03:38 PM
I am curious if there is a way to create a select element dynamically using javascript [i.e. every time a button is clicked, another select box appears on the screen] I know you can add objects to a pre existing select using something like:

var myNewOption = new Option("TheText","TheValue");
document.theForm.theSelectObject.options[0] = myNewOption;

but I cannot figure out how to create an entirely new select.

Thanks!!