$(function() {
$("#checkAll").toggle(
function () {
$("input[name='id']").each(function() {
$(this).attr("checked", true);
});
},
function () {
$("input[name='id']").each(function() {
$(this).attr("checked", false);
});
});
});