How do you get the currently selected <option> of a <select> element via JavaScript?
<option>
<select>
This will do it for you:
var yourSelect = document.getElementById( "your-select-id" ); alert( yourSelect.options[ yourSelect.selectedIndex ].value )
1.4m articles
1.4m replys
5 comments
57.0k users