title: Select dynamically added li in Jquery
body: <p>I am appending li in a Ul dynamically with a rel attribute. Now I need to select the last li and it's attributes. But it is unable to select the dynamically added li.</p>
  
  <pre><code>  var lastRel = $("#ulid li:last").attr("rel");
  
  
  $("#addLi").on('click', function(){
  $("ul").append('&lt;li rel="5"&gt;5&lt;/li&gt;');
  });
  
  
  $("#getLast").on('click', function(){
  alert(lastRel);
  });
  </code></pre>
  
  <p>Check this Fiddle.. </p>
  
  <p><a href="https://jsfiddle.net/oum8e687/1/" rel="nofollow noreferrer">FIDDLE</a></p>