I have a very simple structure as shown below. what I am trying to do in jquery is find all dropdowns where the checkbox is checked.
<table>
<tr>
<td> <asp:DropDownList ID="ddDurationHours" runat="server"/> <td>
<td>Data<td>
<td>Data<td>
<td> <asp:CheckBox runat="server" ID="chkDelete"/> </td>
<td>Data<td>
</tr>
<tr>
<td><asp:DropDownList ID="ddDurationHours" runat="server"/> </td>
<td>Data<td>
<td>Data<td>
<td> <asp:CheckBox runat="server" ID="chkDelete"/> </td>
<td>Data<td>
</tr>
</table>
I have tried few things can’t remember them all but my latest attempt is:
var hoursDropdowns = jQuery('select[name*="ddDurationHours"]').closest('tr').find('td:first input[name*="chkDelete"]:checked:enabled');
Has anyone got a clue as I am banging my head trying to work this out.
Use class selector for both dropdown and checkbox for much cleaner selector