Get selected text from a drop-down list (select box) using jQuery

Get selected text from a drop-down list (select box) using jQuery

How can I get the selected text (not the selected value) from a drop-down list in jQuery?

Solutions/Answers:

Solution 1:

$("#yourdropdownid option:selected").text();

Solution 2:

Try this:

$("#myselect :selected").text();

For an ASP.NET dropdown you can use the following selector:

$("[id*='MyDropDownId'] :selected")

Solution 3:

The answers posted here, for example,

$('#yourdropdownid option:selected').text();

didn’t work for me, but this did:

$('#yourdropdownid').find('option:selected').text();

It is possibly an older version of jQuery.

Solution 4:

If you already have the dropdownlist available in a variable, this is what works for me:

$("option:selected", myVar).text()

The other answers on this question helped me, but ultimately the jQuery forum thread $(this + “option:selected”).attr(“rel”) option selected is not working in IE helped the most.

Update: fixed the above link

Solution 5:

$("option:selected", $("#TipoRecorde")).text()

Solution 6:

This works for me

$("#dropdownid").change(function() {
    alert($(this).find("option:selected").text());
});

If the element created dynamically

$(document).on("change", "#dropdownid", function() {
    alert($(this).find("option:selected").text());
});