Possible Duplicate:
jQuery get select option text
I have a drop downlist as like:
<select id="systemMessageList" name="systemMessageList">
<option value="-1">--- Choose One ---</option>
<option value="120">niempo</option>
<option value="119">quartero</option>
<option value="118">mileno</option>
</select>
I want that: I will pass the value for example 119
and it will return the text quartero
in JQuery?
For the text of the selected option, you need:
$('#systemMessageList option:selected').text();
For the value you can just use
$('#systemMessageList').val();
Edit: the other answers are probably what you want. I'm just showing you how to get the text and value of whichever option is selected.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With