I'm creating a new option list depending on the option chosen in another. I'm using a switch to assess value of the selected index, then using a case statement assign the appropriate values to an array. This is what I have.
I placed an alert afterCode:var element = [[1,'Old Man','Old Man'],[2,'Old Dog,'Old Dog']]; var id = document.getElementById('selectname'); var Opt = id.createElement('Option'); id.options.add(Opt); var id = Opt.id; var value = Opt.value; var text = Opt.text; insertOption(id,value,text);
an it executes. I then placed the alert afterCode:var id = document.getElementById('selectname');
but it won't execute. Can't figure out why? Any help appreicated.Code:var Opt = id.createElement('Option');


Reply With Quote
Bookmarks