get the text value of a selected option.

1 <select id="myselect">
2     <option value="1">Mr</option>
3     <option value="2">Mrs</option>
4     <option value="3">Ms</option>
5     <option value="4">Dr</option>
6     <option value="5">Prof</option>
7 </select>

1, get value:

$( "#myselect" ).val();
//=> 1

2, get (inner)text:

$( "#myselect option:selected" ).text();
// => "Mr"

ref: How do I get the text value of a selected option?

posted @ 2014-05-19 00:37  wonkju  阅读(165)  评论(0编辑  收藏  举报