1<select id="ddlViewBy">
2 <option value="1">test1</option>
3 <option value="2" selected="selected">test2</option>
4 <option value="3">test3</option>
5</select>
6
7<script>
8 var e = document.getElementById("ddlViewBy");
9 var strUser = e.value; // 2
10 var strUser = e.options[e.selectedIndex].text; //test2
11</script>