<select id="ddlist">
-- <option value="1">test1</option>
<option value="2" selected="selected">test2</option>
<option value="3">test3</option>
</select>
var a = document.getElementById("ddlist");
var selectedValue = a.options[a.selectedIndex].value; // outputs 2
or
var selectedValue = a.options[a.selectedIndex].text; // outputs test2
If the above is not what you are looking for please, paste here some of your code so we can understand better what you problem is exatly and help you.
You received this message because you are subscribed to the Google Groups "JavaScript Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to javascript-information+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.