Obtain Select Input Value
<select id="menulist">
<option value="1">test1</option>
<option value="2" selected="selected">test2</option>
<option value="3">test3</option>
</select>
<script>
var e = document.getElementById("menulist");
var optvalue = e.options[e.selectedIndex].value; // the option value attribute
var opttext = e.options[e.selectedIndex].text; // internal text inside option element
</script>
No comments:
Post a Comment