say I have a dropdown list like this:
Google Bing
A modern alternative:
const textToFind = 'Google'; const dd = document.getElementById ('MyDropDown'); dd.selectedIndex = [...dd.options].findIndex (option => option.text === textToFind);