Get the id of selected value from dropdown using jQuery

HTML:

<select id="getId">
   <option value="1">one</option>
   <option value="2">two</option>
   <option value="3">three</option>
   <option value="4">four</option>
</select>

jQuery:

$("#getId").on('change', function () {
    alert($(this).val());
});

6 thoughts on “Get the id of selected value from dropdown using jQuery”

Leave a Reply to Lorritrant Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>