17
Answers

how to get the selected of all the drop downs using jquery

ashok kumar

ashok kumar

11y
2.4k
1
Hi,
   All iam doing an tooltip type validation in my webpage in which i need to get all Dropdowns selected index ,if dropdown selected index is -1 then i should open an tooltip ,the logic for tool tip is working fine,but how to get the selected item index of all my drop downs, i tried something like this didnt workedout.
Pls help me out.atleast in the alert if i get all the dropdowns selected index it will be fine.

 var parentsa = $('#aspnetForm');
                          $("input,select", parentsa).mouseover(function () {
                              var selected = $("input,select", parentsa).options[$("input,select", parentsa).selectedIndex].value;
                             
                              $("input,select", parentsa).tooltip("open");
                              alert(selected);

                          });
Answers (17)