jQuery: manipulating through children to check the checkbox in a table row
- by gsquare567
$("tr.clickable").each(function() {$(this).click(function() {
$(this).children("td:first > input").is(":checked") ?
$(this).children("td:first > input").removeAttr("checked") :
$(this).children("td:first > input").attr("checked","checked");
})});
this only checks the first row in my table (no matter which row i click on). how can i apply it so that it checks the input on the specific row i click on? thanks!
HTML:
<tr id="row0" class="alternate clickable">
<td><img width="11" height="11" title="This email failed to send." alt="Failed" src="images/error_warning.png"><br>
<input type="checkbox" value="6751" name="emailCheck[]" class="emailCheck">
</td>...