title: jQuery push text to array
body: <p>I'm simply just trying to push the text of an <code>li</code> element when I click the add button. But when I click my add button, it is pushing all the items in my list to the array. I guess it's because I'm just using a class. What would be the best way around this? Thanks in advance!</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;div id="products"&gt;
      &lt;ul&gt;
          &lt;li&gt;&lt;p&gt;Lorem 1&lt;/p&gt;&lt;button class="target"&gt;Add&lt;/button&gt;&lt;/li&gt;
          &lt;li&gt;&lt;p&gt;Lorem 2&lt;/p&gt;&lt;button class="target"&gt;Add&lt;/button&gt;&lt;/li&gt;
      &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>jQuery</strong></p>
  
  <pre><code>$(document).ready(function(){
      var array = Array();
      $(".target").click(function() {
          $('p').each(function (i, e) {
                array.push($(e).text());  
          });
          console.log(array);
      });
  });
  </code></pre>