My code generates HTML forms from a template, and populates them with whatever input elements are required by the data being processed at the time. The resulting forms contain groups of checkboxes, each of which have their own 'check all' box. E.g.:

```
<p>Your breakfast order</p>
<div class="a_bunch_of_checkboxes">
<input type="checkbox" class="checkAll">Check All
<input type="checkbox">Toast
<input type="checkbox">Eggs
<input type="checkbox">Bacon
</div>

<p>Your lunch order</p>
<div class="a_bunch_of_checkboxes">
<input type="checkbox" class="checkAll">Check All
<input type="checkbox">Salad
<input type="checkbox">Pizza
<input type="checkbox">Hot Dogs
</div>

```

Etc. (Obviously each "Check All" checkbox would check all boxes in that particular group only.)

I am not too well versed in javascript and jQuery, and I have tried but failed to come up with the appropriate jQuery code to register an event handler to the "check all" checkboxes.

Can anyone point me into the right direction?