title: Getting multiple checked checkbox labels into an array
body: <p>I am hoping to get all the checked checkboxes from my form into an array.</p>
  
  <p>Here is what I did.</p>
  
  <p><code>$("div.category-panel input:checked").next ('label').text();</code> perfectly gets all the checked checkboxes but it just shows them together as one text. As an example, <code>checkbox1</code>, <code>checkbox2</code> and <code>checkbox3</code> (if checked) would show as <code>checkbox1checkbox2checkbox3</code>.</p>
  
  <p>I was hoping to get these different checkboxes in an array so that I can use them.</p>
  
  <pre><code>    $('.submit').on("click", function(e) {
  
      //got all checked checkboxes into 'children'.            
      children = $("div.category-panel input:checked").next ('label').text();
  
      //Put in array.            
      var array = [];
      var i = 0;
      $.each(children, function(key, value){
          array.push($(this).text());
      });
  
      //Show the array.
      for (var i = 0; i &lt; array.length; i++) {
        console.log(array[i]);
      }
  
   });
  </code></pre>
  
  <p>HTML, just in case is:-</p>
  
  <pre><code>&lt;div class="category-panel"&gt;
  
  &lt;input type="checkbox" name="name_service2" id="tid-46" value="46" checked="checked"&gt; &lt;label class="option" for="edit-tid-46"&gt;CheckBox1&lt;/label&gt;
  
  &lt;input type="checkbox" name="name_service3" id="tid-47" value="47" checked="checked"&gt; &lt;label class="option" for="edit-tid-47"&gt;CheckBox2&lt;/label&gt;
  
  &lt;input type="checkbox" name="name_service4" id="tid-44" value="44" checked="checked"&gt; &lt;label class="option" for="edit-tid-44"&gt;CheckBox3&lt;/label&gt;
  
  &lt;input type="checkbox" name="name_service5" id="tid-48" value="48" checked="checked"&gt; &lt;label class="option" for="edit-tid-48"&gt;CheckBox4&lt;/label&gt;
  
  &lt;/div&gt;
  </code></pre>