1.方法一
<input type="checkbox" onclick="checkboxOnclick(this)" /> <script> function checkboxOnclick(checkbox){ if ( checkbox.checked == true){ //Action for checked }else{ //Action for not checked } }
2.方法二
$('#allSelect').click(function () { if ($('#allSelect').prop('checked') == true) { $("[all='1']").prop('checked', true); } else { $("[all='1']").prop('checked', false); } })