SO - 18537609

by Arun P Johny

HTML

<input type="checkbox" id="checkAll">Check All
<hr />
<input type="checkbox" id="checkItem">Item 1
<input type="checkbox" id="checkItem">Item 2
<input type="checkbox" id="checkItem">Item3

JavaScript

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