I have the following code. It checks all the checkboxes on the page using the LABEL element which is usually on top of the checkboxes. Now how do I use the same LABEL element to uncheck all the boxes?
jQuery(document).ready(function($) {
var $checkBoxes = $('input[type="checkbox"]');
$('label').click(function() {
$checkBoxes.attr('checked', true);
});
});