title: how to trigger click event on dynamically created element in jquery
body: <pre><code>if($('#term').children().length == 0){
          $("#term").append("&lt;ul id='ulDynamic' class='ulDynamic'&gt;&lt;/ul&gt;");
          var i;
          for(i=1;i&lt;=3;i++){
              var liDynamic = "Term "+i;
              var liId = "Term"+i;
              $("#ulDynamic").append("&lt;li id="+liId+ " class='listDynamic'&gt;"+ liDynamic +"&lt;/li&gt;");
                      if(i==0){
                         $('#'+liId).click();
          }
      }
  </code></pre>
  
  <p>.click() is not working since liId is a dynamically created element. I want the first li element to be auto clicked when the page loads. Is there any other way to do it?</p>