How can I get the selected value of a drop-down list with jQuery?

With jQuery, it?s easy to get selected text from a drop-down list. This is done using the select id. To change the selected value of a drop-down list, use the val() method.

Example

You can try to run the following code to learn how to change the selected value of a drop-down list. Here, we have a default select option first, but the alert shows the second option, which have been changed using the val method():


   
      jQuery Selector
      
   
      
   
   
   

      
       

The selected value:

             
         
Updated on: 2026-03-11T23:14:17+05:30

8K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements