title: jQuery, increment id number when dynamically appending elements
body: <p>I'm probably going about this wrong but here goes. I have a form that you fill out with a section in the middle that lets you add more addresses with an "add more" button. </p>
  
  <p>My html:</p>
  
  <pre><code>&lt;div class="address"&gt;
     &lt;div class="street"&gt;
        &lt;input type="text" name="street[]"&gt;
     &lt;/div&gt;
     &lt;div class="city"&gt;
        &lt;input type="text" name="city[]"&gt;
     &lt;/div&gt;
     &lt;div class="addmoreadd"&gt;
        &lt;button type="button" id="addmore"&gt;Add More Address&lt;/button&gt;
     &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>jQuery:</p>
  
  <pre><code>var rowNum = 0;
  
  $("#addmore").click(function() {
        rowNum++;
        $('.address').attr('id', 'address' + rowNum);
        var html = $('.address').html();
        jQuery('.address').append(html)
        var rm = "&lt;button type='button' class='btn' id='rmbtn'&gt;Remove&lt;/button&gt;"
        $('addmoreadd').append(rm);  
  
        $('#rmbtn').click(function() {
          $('#address' + rowNum).remove();
       }); 
   });
  </code></pre>
  
  <p>I'm new to jquery so I'm still learning syntax and function but here I am trying to append the extra address fields on each click of the "add more address" button, increment the parent div <code>&lt;div class="address"&gt;</code> by adding an id # to identify the number for the Remove button to locate. I want the user to be able to only remove additional addresses after the first default address. </p>
  
  <p>This executes ok when the add more address button is clicked once, afterwards it keeps adding more Remove buttons next to each other. Also when adding more address fields the id's are the same (rows of #address0). </p>
  
  <p>Please guide me o the right direction!</p>
  
  <p>EDIT: Here is the original example that I had that wasn't working with an add more phone button:</p>
  
  <p><a href="http://jsfiddle.net/F4UhN/" rel="noreferrer">http://jsfiddle.net/F4UhN/</a></p>