I'm trying to change the selected option of a select, I have already tried this way:
document.getElementById("myselect").value = "1";
and also
document.getElementById("myselect").selectedIndex = 1;
but with the first one, it doesn't work, instead of changing to the option with the value 1, it goes to the last option of the select, and with the second one it doesn't work at all. Any suggestions?