In an HTML page and with JQuery, I am trying to select all dropdown elements excluding their labels with the following selector. Can this selector be simplified? Thanks.
$('[id^=GG0130A_Admission]:not(label[id^=GG0130]), [id^=GG0130B_Admission]:not(label[id^=GG0130]), [id^=GG0130C_Admission]:not(label[id^=GG0130]),[id^=GG0130D_Admission]:not(label[id^=GG0130]),[id^=GG0130E_Admission]:not(label[id^=GG0130]),[id^=GG0130F_Admission]:not(label[id^=GG0130]),[id^=GG0130G_Admission]:not(label[id^=GG0130]),[id^=GG0130H_Admission]:not(label[id^=GG0130])').each(function () {}
@epascarello, thank you for mentioning common class. Each Admission <SELECT> element (A to H) has a sibling Discharge <SELECT> with the same prefix but different suffix. I used a common class and :not() to achieve what I need. Here is the selector.
$('.persistable[id^=GG0130]:not([id*=Discharge])')