0

How can I get the selected text (not the selected value) from the dropdown list in my select box in JQuery.

I try this codes

var my_handlers = {

    fill_provinces: function () {

        var region = $("#province").children("option").filter(":selected").text()
        
    },
  • Does this answer your question? [Get selected text from a drop-down list (select box) using jQuery](https://stackoverflow.com/questions/1643227/get-selected-text-from-a-drop-down-list-select-box-using-jquery) – akseli Oct 28 '22 at 03:01

1 Answers1

0

Sample select field that id is "selectId",

<select id="selectId">
    <option value="1">Mr</option>
    <option value="2">Mrs</option>
    <option value="3">Ms</option>
    <option value="4">Dr</option>
    <option value="5">Prof</option>
</select>

You can directly get selected text using,

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