Javascript Help - dynamic option
I am trying to create a drop down box where the contents is controlled. For instance when one option is selected it makes a row in a table appear and then the option is deleted from the drop down menu. Then when another is selected the process continues.
function reproduce(id) {
document.getElementById('choice').style.visibility='visible';
document.getElementById('message').innerHTML=document.forms['typefrm'].type.options[id].innerHTML;
alert(id);
}
This just gets the value of the selected option and then sets the table to visible and popultes the innerHTML (a div) with the value of the selected option.
But i cant find the actual index of the option - only the value so the innerHTML of the option is not displayed properly?
If this all makes sense.