title: JQuery - Loop through DIVs with the same class and create Array for each of them
body: <p>I do have many DIVs with the same class <code>.list</code>. They are filled with other divs with the ID <code>element</code>. In these <code>element</code> divs there a checkboxes and textfields. I'm able to get all the checked checkboxes' next Textfield's value. I've saved them into one Array but I want an Array for each <code>.list</code>. </p>
  
  <p>That's how my Code looks so far:</p>
  
  <pre><code>function test(){
   var array = new Array();
      $(".list &gt; #element").each(function(){
      array.push($(this).find('input:checkbox[class=unterpunkte]:checked').next('input[type=textfield]').val());
      });
      console.log(array);
  }
  </code></pre>
  
  <p>How can I dynamcially creat an Array for each list. I don't want to have one Array where all the Values are saved. I need Arrays for each div with class <code>.list</code>. Any ideas?</p>
  
  <p>HTML/PHP:</p>
  
  <pre><code>echo("&lt;div class='list' name='$oberpname' value='$oberpname'&gt;");
  
          while($satz != null)
          {
              echo("&lt;div id='element'&gt;&lt;label&gt;&lt;input type='checkbox' class='unterpunkte' name='$satz[unterpname]' value='$satz[unterpid]'&gt;&lt;input type='textfield' class='$oberpname' value='$satz[unterpname]' readonly/&gt;&lt;/label&gt;&lt;/div&gt;");
              $satz=mysql_fetch_assoc($cursor);
          }
  
          echo("&lt;/div&gt;"); //.list div end
  </code></pre>
  
  <p>EDIT NOTE: Added HTML/PHP</p>