Button to select all checkboxes within a div using jquery
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1271097/select-all-checkboxes-command-jquery-javascript">select all checkboxes command jquery, javascript</a>  </p>
</blockquote>



<p>I am having trouble selecting all checkboxes in a div with jquery. This is the code that I currently have for the function</p>

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

<p>Any help is greatly appreciated.</p>
