$("#all").click(function () { if($(this).is(":checked")){ $("input[name='product']").prop("checked",true); }else{ $("input[name='product']").prop("checked",false); } })