Given an HTML form element like:
Spam Eggs
I'd use the selectedIndex or a loop to select the option by text, the code below doesn't work.
document.getElementById("mydropdown").text = 'Eggs';