I have a dropdown menu and I cannot figure out how to make a javascript function select a drop down menu option. I have tested the output of the variables and they are all corre
Change the line that reads:
document.getElementById("stateSelect").selected = true;
to:
document.getElementById("stateSelect").selectedIndex = i;