title: Select All checkboxes using jQuery
body: <p>I have the following html code:</p>
  
  <pre><code>    &lt;input type="checkbox" id="ckbCheckAll" /&gt;
      &lt;p id="checkBoxes"&gt;
          &lt;input type="checkbox" class="checkBoxClass" id="Checkbox1" /&gt;
          &lt;br /&gt;
          &lt;input type="checkbox" class="checkBoxClass" id="Checkbox2" /&gt;
          &lt;br /&gt;
          &lt;input type="checkbox" class="checkBoxClass" id="Checkbox3" /&gt;
          &lt;br /&gt;
          &lt;input type="checkbox" class="checkBoxClass" id="Checkbox4" /&gt;
          &lt;br /&gt;
          &lt;input type="checkbox" class="checkBoxClass" id="Checkbox5" /&gt;
          &lt;br /&gt;
      &lt;/p&gt;
  </code></pre>
  
  <p>When user checks <code>ckbCheckAll</code> all checkboxes must be checked. Also I have following jquery code:</p>
  
  <pre><code>    $(document).ready(function () {
          $("#ckbCheckAll").click(function () {
              $(".checkBoxClass").attr('checked', this.checked);
          });
      });
  </code></pre>
  
  <p>When I see my page in the browser I get the following result:
  In the first click on <code>ckbCheckAll</code> all checkboxes were checked (which is correct). In the second click on <code>ckbCheckAll</code> all checkboxes were unchecked (which is correct). But in 3rd attempt nothing happened! also in 4th attempt nothing happened and so on.</p>
  
  <p>Where is the problem?</p>