my checkAll Checkboxes script not work
<p>I Am using jquery 1.6.1 for checking all a group of checkboxes.<br>
this is my HTML Code:</p>

<pre><code> &lt;form action=""&gt;
    &lt;div class="stats"&gt;
      &lt;h2 class="title"&gt;Reason for Celebrity&lt;/h2&gt;
      &lt;input name="reason" type="checkbox" value="net" /&gt;Famous on the internet&lt;br/&gt;
      &lt;input name="reason" type="checkbox" value="crim" /&gt;Committed a crime&lt;br /&gt;
      &lt;input name="reason" type="checkbox" value="model" /&gt;Dates a super model&lt;br /&gt;
      &lt;input name="reason" type="checkbox" value="tv" /&gt;Hosts a TV show&lt;br /&gt;
      &lt;input name="reason" type="checkbox" value="japan" /&gt;Big in Japan&lt;br /&gt;
      &lt;hr /&gt;
      &lt;input class="check-all" name="reason" type="checkbox" /&gt;&lt;span&gt;Check all&lt;/span&gt;
      &lt;br/&gt;
      &lt;input type="submit" value="Submit" class="submit" /&gt;
    &lt;/div&gt;
  &lt;/form&gt;
</code></pre>

<p>and my script for check all is like this:</p>

<pre><code>$(document).ready(function(){
  $('.check-all:checkbox').change(function() {
    var group = ':checkbox[name=' + $(this).attr('name') + ']';
    $(group).attr('checked', $(this).attr('checked'));
  });
});
</code></pre>

<p>but this not work on uncheck of checkboxes. can you help me solve this problem?</p>
