I am using the following jquery to achieve check all effect in a php page:-
<script>
$(function(){
$("#checkall").click(function(){
if($("#checkall").attr('checked')){
$(".department").attr('checked', true);
}else{
$(".department").attr('checked', false);
}
});
});
</script>
<input type="checkbox" id="checkall" name="check_all" />
<input type="checkbox" name="department[]" class="department" value="" checked = "checked"/>
and the check all and uncheck all effect works fine. However, it doesn't work with the reset button in the form. How shall I modify the jquery? Thanks!