Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
28
rated 0 times [  32] [ 4]  / answers: 1 / hits: 38983  / 12 Years ago, thu, december 13, 2012, 12:00:00

I am using drop down with multiple select name defined with select[]





How can I get selected values using jquery.


More From » jquery

 Answers
210

The same way as any form element - use val().



var selectedValues = $(#select).val();


With a multiple select you will see the value as a comma delimited string which can easily be posted for server-side processing or split into an array if required.



Example fiddle


[#81450] Wednesday, December 12, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
teagan

Total Points: 98
Total Questions: 106
Total Answers: 101

Location: Tajikistan
Member since Thu, Apr 14, 2022
2 Years ago
;