title: Jquery adding and removing inputs
body: <p>Hee!</p>
  
  <p>I'm trying to make a script that's adding en removing parts to a fieldset 
  <a href="https://jsfiddle.net/3kcoxsac/2/" rel="nofollow">https://jsfiddle.net/3kcoxsac/2/</a></p>
  
  <p>Now the adding part is working perfectly, only the remove part is just working on the first div and not on the newly added</p>
  
  <p>the html:</p>
  
  <pre><code>&lt;fieldset class="p-bottom-12 bg-white p-around-12 m-bottom-60 u-border-radius"&gt;
    &lt;div id="js-artist" class="table u-border-box"&gt;
      &lt;div class="js-artist u-flex-row p-top-12 u-border-top"&gt;
        &lt;input class="m-left-24 small m-right-24 form-input w-100 cell-10 u-flex u-break" type="text" id="artiestNaam" placeholder="Artiest naam"&gt;&lt;input class="form-input small m-right-24 w-100 cell-10 u-flex u-break form-error" type="url" id="artiestURL" placeholder="Artiestenpagina of website"&gt;&lt;span class="js-removeArtist cell-w40 large cell-lineheigt u-pointer secondary_color-fixed"&gt;&lt;i class="fa fa-trash-o" aria-hidden="true"&gt;R&lt;/i&gt;&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;span id="js-addArtist"&gt;add&lt;/span&gt;
  &lt;/fieldset&gt;
  </code></pre>
  
  <p>The jquery:</p>
  
  <pre><code> var artist = $('#js-artist'),
     i = 1;
   $('#js-addArtist').click(function() {
     $('&lt;div class="js-artist u-flex-row p-top-12 u-border-top"&gt;&lt;input class="m-left-24 small m-right-24 form-input w-100 cell-10 u-flex u-break" type="text" id="artiestNaam_' + i + '" placeholder="Artiest naam"&gt;&lt;input class="form-input small m-right-24 w-100 cell-10 u-flex u-break" type="text" id="artiestURL_' + i + '" placeholder="Artiestenpagina of website"&gt;&lt;span class="js-removeArtist cell-w40 large cell-lineheigt u-pointer secondary_color-fixed"&gt;&lt;i class="fa fa-trash-o" aria-hidden="true"&gt;R&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;').appendTo(artist);
     i++;
   });
   $('.js-removeArtist').click(function() {
     alert();
     if (i &gt; 1) {
       $(this).parents('.js-artist').remove();
       i--;
     }
   });
  </code></pre>
  
  <p>so if you click on the R on the newly added parts, its not working while i'm adding the same html as the one were its working </p>