If one checkbox is selected, automatically select the rest on page jQuery?
<p>If the checkbox with the class "selectAll" is checked I want the rest of the checkboxes on the page to automatically be checked. I got this working with the following:</p>

<pre><code>$('.selectAll').click(function() {
    $("input[type='checkbox']").attr('checked', true);
});
</code></pre>

<p>But I want all checkboxes to be unchecked when select all is clicked again, I can't get that part working. How can that be done?</p>
