I have HTML table. This is one of the rows:
<tr class="mattersRow">
<td colspan="4"> … </td>
<td class="editableCell qbmatter" colspan="14"> … </td>
<td class="editableCell workDate" colspan="4"> … </td>
<td class="editableCell hours" colspan="2"> … </td>
<td class="editableCell person" colspan="6"> … </td>
<td class="rate" colspan="2"> … </td>
<td class="editableCell amount" colspan="4"> … </td>
<td align="center">
<input id="check4" type="checkbox"></input>
</td>
</tr>
Last column contains check box. When I check/uncheck it I want to add/remove css class for this row.
$("input[type=checkbox]").click(function () {
if ($(this).is(':checked')) {
// Mark this Row Yellow
$(this).closest('tr').addClass('warning');
}
else {
// Remove Yellow mark and put back danger if needs
$(this).closest('tr').removeClass('warning');
}
});
This class makes whole row Yellow color. Basically I want to do this with some effect. For example when I uncheck, this "Yellow" is falling down... How to do this in jQuery? Is it possible?