How can I get the selected text (not the selected value) from a drop-down list in jQuery?
Or to get the text of the option, use text() : $var = jQuery("#dropdownid option:selected"). text(); alert ($var);
Use the jQuery: selected selector in combination with val () method to find the selected option value in a drop-down list.
$("#yourdropdownid option:selected").text();
Try this:
$("#myselect :selected").text();
For an ASP.NET dropdown you can use the following selector:
$("[id*='MyDropDownId'] :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