jQuery change select option value and text – How to get selected text from a drop-down list using jQuery?

jQuery change select option value and text – get the selected text (not the selected value) from a drop-down list in jQuery.

jQuery change select option value and text

You can use the jQuery :selected selector in combination with the text() method. To get the selected text, we can use the following JQuery code.

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

Get selected text from a drop-down list (select box) using jQuery – We can select text or we can also find the position of a text in a drop down list using option:selected attribute.

$("#memberList").val();

Get Selected Option Text of HTML SELECT using jQuery




How to Get the Text Value of Selected Option using jQuery?

HTML Code


Don’t Miss : jquery selected option text.

$(document).ready(function(){
    $('#memberList').on('change',function(){
        //var optionValue = $(this).val();
        //var memberTxt = $('#memberList option[value="'+optionValue+'"]').text();
        var memberTxt = $("#memberList option:selected").text();
        alert("Selected Option Text: "+memberTxt);
    });
});

I hope you get an idea about jQuery change select option value and text.
I would like to have feedback on my infinityknow.com.
Your valuable feedback, question, or comments about this Article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Leave a Comment