SO - 18537609

by John Doe

HTML

<input type="checkbox" id="checkAll1">Check All<br>
<input class='t1' type="checkbox" id="checkItem">Item 1<br>
<input class='t1' type="checkbox" id="checkItem">Item 2<br>
<input class='t1' type="checkbox" id="checkItem">Item3<br>
<br>
<input type="checkbox" id="checkAll2">Check All<br>
<input class='t2' type="checkbox" id="checkItem">Item4<br>
<input class='t2' type="checkbox" id="checkItem">Item5<br>

JavaScript

$("#checkAll1").click(function () {
     $('input:checkbox').not(this).prop('checked', this.checked);
 });