title: Storing selected checkboxes into an array jQuery
body: <p>How do I take only the selected checkboxes and store them into an array when the button is clicked?</p>
  
  <p>This is the code I currently have. It is not finished because I'm not sure what to do as I am new to jQuery</p>
  
  <pre><code>$(document).ready(function() {
      // code
      var configs = [];
      var testPages = [];
  
      $("button").click(function(){
          $(".testpages")....
          $(".configs").....
      })
  });
  </code></pre>
  
  <p>Html:</p>
  
  <pre><code>&lt;form&gt;
    &lt;div class="test"&gt;
      &lt;input id="1" type="checkbox" value="val1"&gt;a&lt;br&gt;
      &lt;input id="2" type="checkbox" value="val2"&gt;b&lt;br&gt;
      &lt;input id="3" type="checkbox" value="val3"&gt;c&lt;br&gt;
    &lt;/div&gt;
    &lt;div class="config"&gt;
      &lt;input id="10" type="checkbox" value="val10"&gt;a1&lt;br&gt;
      &lt;input id="11" type="checkbox" value="val11"&gt;a2&lt;br&gt;
      &lt;input id="12" type="checkbox" value="val12"&gt;a3&lt;br&gt;
    &lt;/div&gt;
  &lt;/form&gt;
  &lt;button type="button"&gt;submit&lt;/button&gt;
  </code></pre>