Reputation: 1555
<select id="my-select">
<option value="1">This is one</option>
<option value="2" selected>This is two</option>
...
</select>
Is there a way to get the text value of the selected option?
$('#my-select').val();
gives me 2, i want to get This is Two instead.
How?
Upvotes: 3
Views: 2815
Reputation: 187030
What you want is
Use .text()
on the selector.
$('#my-select option:selected').text();
See a working demo
Upvotes: 10