I'm trying to change the css of the following label using JQuery but I can't figure it out. This is actually the html from my checkboxlist (asp.net) and this is what I have so far. Can anybody please help? Thank you.
The JQuery below finds the entire table and makes all labels red, not just the one that I checked.
$("#CheckBoxList1").click(function() {
$(this).find('label').removeClass('red');
if ($('span').hasClass('checked'))
$(this).find('label').addClass('red');
});
<table id="CheckBoxList1" border="0">
<tbody>
<tr>
<td>
<div class="checker" id="uniform-CheckBoxList1_0">
<span>
<input id="CheckBoxList1_0" type="checkbox" name="CheckBoxList1$0" style="opacity: 0; "/>
</span>
</div>
<label for="CheckBoxList1_0">Mark Park</label>
</td>
<td>
<div class="checker" id="uniform-CheckBoxList1_1">
<span>
<input id="CheckBoxList1_1" type="checkbox" name="CheckBoxList1$1" style="opacity: 0; "/>
</span>
</div>
<label for="CheckBoxList1_1">Amy Lee</label>
</td>
<td/>
</tr>
</tbody>
</table>