var regularBoxes = $("input[@type=checkbox]").not("#allToggle"); $("#allToggle").click(function(){ if ($("#allToggle").attr("checked") == true) { regularBoxes.removeAttr("checked"); } }); regularBoxes.click(function(){ $("#allToggle").removeAttr("checked"); });