jquery | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

jquery

How to i get unselected options in dropdown , when user selected the option im gtng like $(ā€œ#id option:selectedā€).val() or .text but i want unselected values for checking dynmaic conditions.. if any one knw kindly share ur answers. Thank you

22nd Apr 2018, 9:34 AM
MőhĆ„Åˆ ĶűmĆ¦Å™
MőhĆ„Åˆ ĶűmĆ¦Å™ - avatar
1 Resposta
+ 2
<select id="sel"> options </select> $("#sel option:not(:selected)") will return an array of objects containing the not selected ootions. can do $.each($("#sel option:not(:selected)"), function() { // do something with $(this).val() });
22nd Apr 2018, 9:45 AM
Adam
Adam - avatar