title: How do I add a click event to .append() data in jQuery?
body: <p>Okay, I've kind of painted myself into a corner, with respect to my jQuery (I'm learning).</p>
  
  <p>In the HTML I have:</p>
  
  <pre><code>&lt;div class="folders-hierarchy"&gt;
      &lt;ul id="folders-hierarchy"&gt;&lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And the jQuery is:</p>
  
  <pre><code>$(document).ready(function(){
      function get_folders_hierarchy () {
          var folder_id = ($(this).attr("data-folder") == false) ? 0 : $(this).attr("data-folder");
          $.ajax({
              url: base_url + "folders/jq_get_folders_hierarchy/" + 0,
              contentType: "application/json; charset=utf-8",
              dataType: "json",
              cache: false,
              success: function (element) {
                  for (var i=0;i&lt;element.length;i++) {
                      $("#folders-hierarchy").append('&lt;li data-folder="' + element[i].folder_id + '"&gt;' + element[i].name + '&lt;/li&gt;');
                  }
              }
          });
      }
      get_folders_hierarchy();
  });
  </code></pre>
  
  <p>While this all works for the first run, I need to add a click event to the unnumbered list item in the .append() function. Sadly, I don't know how.</p>
  
  <p>Just so you know, I'm attempting to create a folder selector, which the unnumbered list is designed to render.</p>