jQuery get selected option value


jQuery get selected option value: You can get selected option value of html select box as below.


Syntax : jQuery get selected option value

Syntax to get selected option value of dropdown menu can be as :
Suppose we have following drop down list


<select id="demo">
    <option value="0">first</option>
    <option value="1">second</option>
    <option value="2">third</option>
</select>

You can get selected value in jquery as :


$("#demo").change(function () {
$("#demo :selected").attr('value');

});

Try it »


Advertisements

Add Comment

📖 Read More