javascript how to get option value from select code example
Example 1: html get selected option javascript
<select id="ddlViewBy">
<option value="1">test1</option>
<option value="2" selected="selected">test2</option>
<option value="3">test3</option>
</select>
<script>
var e = document.getElementById("ddlViewBy");
var strUser = e.value;
var strUser = e.options[e.selectedIndex].text;
</script>
Example 2: use js to get select value
var sel = document.getElementById('scripts');
console.log( sel.value );