title: Adding/removing <li> elements with jQuery
body: <p>I just started to learn JavaScript/jQuery, and I made a little test website to practice coding.</p>
  
  <p>In one of the tests I made, there is a  list that says Milk and Eggs. There is an input field and a button, which you can type something, click the button, and add it to the list. I then added an option where if you click on one of the list items, it removes it. This works, but only on the preset Milk and Eggs items, not any items that you add yourself.</p>
  
  <p>I think it's because the code wasn't loaded for the newly added items, but I'm not sure. Can someone help?</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta charset="utf-8"&gt;
  &lt;title&gt;Practice 3&lt;/title&gt;
  &lt;link href="index.css" rel="stylesheet" type="text/css"&gt;
  &lt;script src="http://code.jquery.com/jquery-2.1.3.min.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
      &lt;div class="Title" align="center"&gt;
          &lt;h1&gt;Hello&lt;/h1&gt;
          &lt;p&gt;This website will use JavaScript to create interactive elements.&lt;/p&gt;
      &lt;/div&gt;
  
      &lt;div class="1"&gt;
          &lt;h3&gt;Test 1&lt;/h3&gt;
          &lt;ul id="list"&gt;
              &lt;li&gt;Milk&lt;/li&gt;
              &lt;li&gt;Eggs&lt;/li&gt;
          &lt;/ul&gt;
          &lt;input id="textbox"&gt;
          &lt;button id="add"&gt;Add to list&lt;/button&gt;
      &lt;/div&gt;
  
      &lt;script&gt;
          $('#add').click(function() {
              var listvalue = $('#textbox').val();
                      $("#textbox").val("");
                  $('ul').append('&lt;li&gt;' + listvalue + '&lt;/li&gt;');
          });
  
          $('#textbox').keypress(function(event) {
              if(event.which === 13) {
                  var listvalue = $('#textbox').val();
                      $('#textbox').val("");
                      $('ul').append('&lt;li&gt;' + listvalue + '&lt;/li&gt;');
              }
          });
  
          $('li').click(function(e) {
              $(e.target).remove();
          });
      &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>