title: Javascript not working after appending HTML
body: <p>I have 4 inputs within a form. On click of a button, it appends 1 more text input to the form. I also have a delete button right next to each input so that the user can delete the row if need be. But my question is, after clicking the "add more" button, and it appends the form and adds a new row, the delete button doesn't work because the javascript doesn't know its been added. I thought something like jquery .live() would work but that was deprecated apparently.</p>
  
  <p>This is what's being added onClick of the add more inputs button.</p>
  
  <pre><code>$("#nameInput").append('&lt;tr&gt;&lt;td&gt;&lt;input type="text" id="name'+ inputNumber +'" class="names" name="name'+ inputNumber +'" placeholder="Twitch Username..." value="&lt;?php echo $playerName5 ?&gt;"&gt; &lt;/td&gt;
  &lt;td&gt;&lt;input type="text" id="name'+ inputNumber +'Desired" class="desiredNames" name="name'+ inputNumber +'Desired" placeholder="Desired Username..." maxlength="20" value="&lt;?php echo $desiredName5 ?&gt;"&gt; &lt;/td&gt;
  &lt;td&gt;&lt;a class="btn btn-mini delete" href="JavaScript:void(0);"&gt;&lt;i class="icon-remove-sign icon-large"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;');
  </code></pre>
  
  <p>You can see on the third line I have a class set as "delete". The javascript isn't recognizing this class since this information wasn't originally there when the page loaded I guess.</p>
  
  <p>This is what i'm using to delete the information.</p>
  
  <pre><code>$(".delete").on("click", ".delete", function() {
  
  if (confirm("Are you sure you want to delete this user?")) {
  
    $(this).closest("tr").find(".names").val("");
  
    $(this).closest("tr").find(".desiredNames").val("");
  
    $(this).closest("tr").fadeOut(450);
  
    inputNumber--
  
    if (inputNumber &lt;= advancedPlan) {
  
      $("#addMore").fadeIn(450);
  
      $("#errors").fadeOut(450);
  
    }
  
  }
  
  });
  </code></pre>
  
  <p>EDIT: Nevermind. Minor spelling mistake. You guys were right! Thanks for the help.</p>