say I have a dropdown list like this:
Google Bing
var textToFind = 'Google'; var dd = document.getElementById('MyDropDown'); for (var i = 0; i < dd.options.length; i++) { if (dd.options[i].text === textToFind) { dd.selectedIndex = i; break; } }