0) { window.alert("Text: " + select.options[select.selectedIndex].text + "\nValue: " + select.options[select.selectedIndex].value); } else { window.alert("Select box is empty"); } Example in action. var optionCollection = Array.from(select.options).filter(x => x.text.toLowerCase().startsWith(keyword.toLowerCase())) Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. The HTMLSelectElement.options read-only property returns a HTMLOptionsCollection of the