I need to get a value from a select list, but jQuery returns the text in the select options.
I have the following simple code.
<select id="myselect"> <option selected="selected">All</option> <option value="1">One</option> <option value="2">Two</option> </select>
Then I use the following jQuery, which I thought would get the value
var myOption = $('#myselect').val()
but when I look at myOption , do I get the text "One" or "Two"?
Deviland
source share