If the checkbox with the class “selectAll” is checked I want the rest of the checkboxes on the page to automatically be checked. I got this working with the following:
$('.selectAll').click(function() {
$("input[type='checkbox']").attr('checked', true);
});
But I want all checkboxes to be unchecked when select all is clicked again, I can’t get that part working. How can that be done?
You could change
trueto other parameters…(Test: http://jsbin.com/ogobi5)