title: How to use jQuery each() method within an append()
body: <p>I have a function that adds a new row to a table. I also created a function that gets the value of text input with similar ids. </p>
  
  <p>What I want to do is to append the collected values to the table, one on each column. The final column will contain a delete row link. I cant figure out how to do iteration (maybe an each method?) within an append method. Here is my code.</p>
  
  <p><strong>Add Row Function</strong></p>
  
  <pre><code>$('.addrow').click(function(){
      $('.datatable &gt; tbody:last-child')
       .append($('&lt;tr&gt;')
          .append($('&lt;td&gt;')
              .append($('&lt;a&gt;')
                  .attr('id', 'deleterow')
                  .attr('href','#')
                  .text('delete')
              )
          )
      );
  });
  </code></pre>
  
  <p><strong>Delete Row Function</strong></p>
  
  <pre><code>$('.datatable').on('click', '.deleterow', function(){
      $(this).closest('tr').remove();
  });
  </code></pre>
  
  <p><strong>Get Input Values Function</strong></p>
  
  <pre><code>$("input[class='textinput']").map(function(){return $(this).val();}).get();
  </code></pre>