How do you get the currently selected <option> of a <select> element via JavaScript?
How do you get the currently selected <option> of a <select> element via JavaScript?
Using the selectedOptions property:
var yourSelect = document.getElementById("your-select-id");
alert(yourSelect.selectedOptions[0].value);
It works in all browsers except Internet Explorer.