第1个回答 2014-12-12
<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
<table>
<tr>
<td><input type="checkbox" /></td>
<td><input type="checkbox" /></td>
<td><input type="checkbox" name="check" /></td>
</tr>
<tr>
<td><input type="checkbox" /></td>
<td><input type="checkbox" /></td>
<td><input type="checkbox" /></td>
</tr>
</table>
<script type="text/javascript">
$("input[type='checkbox']").bind('click',function(){
if($(this).attr('checked') == 'checked'){
$('td').css('background-color','red');
}else{
$('td').css('background-color','#fff');
}
});
</script>