title: jQuery Array of all selected checkboxes (by class)
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/416752/select-values-of-checkbox-group-with-jquery">Select values of checkbox group with jQuery</a>  </p>
  </blockquote>
  
  
  
  <p>In HTML I have a set of checkboxes grouped together by a class. I want to get an array in jQuery containing all the checkboxes that are selected/checked for that class (so other checkboxes on the page are ignored). </p>
  
  <p>So HTML code like this:</p>
  
  <pre><code>&lt;input type="checkbox" class="group1" value="18" checked="checked" /&gt;
  &lt;input type="checkbox" class="group1" value="20" /&gt;
  &lt;input type="checkbox" class="group1" value="15" /&gt;
  &lt;input type="checkbox" class="group2" value="14" /&gt;
  &lt;input type="checkbox" class="group1" value="55" checked="checked" /&gt;
  &lt;input type="checkbox" class="group1" value="10" checked="checked" /&gt;
  &lt;input type="checkbox" class="group2" value="77" checked="checked" /&gt;
  &lt;input type="checkbox" class="group1" value="11" /&gt;
  </code></pre>
  
  <p>Would return the values of the checked/selected <code>group1</code> checkboxes into an array like this:</p>
  
  <pre><code>var values = [ 18, 55, 10 ];
  </code></pre>