<select id="myselect"> <option value="1">Mr</option> <option value="2">Mrs</option> <option value="3">Ms</option> <option value="4">Dr</option> <option value="5">Prof</option> </select>
<select id="myselect">
<option value="1">Mr</option>
<option value="2">Mrs</option>
<option value="3">Ms</option>
<option value="4">Dr</option>
<option value="5">Prof</option>
</select>
// => 1 $( "#myselect option:selected" ).text(); // => "Mr"
// => 1
$( "#myselect option:selected" ).text();
// => "Mr"
No comments:
Post a Comment