Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
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:
Advertisements
