return the value of a selected option in a drop-down list
snippet in javascript

return the value of a selected option in a drop-down list

user8345

var e = document.getElementById("selectElementID");
var value=e.selectElement.options[e.selectedIndex].value;// get selected option value
var text=e.options[e.selectedIndex].text;//get the selected option text