Using jQuery .on function
<p>I have an understanding of what the .on function does as far "defining" functions/callbacks once an element is added to the DOM.</p>

<p>My question is, I want to automatically FIRE an event when the element is added to the DOM.</p>

<p>Here's the scenario: First off, I am using AJAX to load my pages, so DOM isReady() does not help me.</p>

<p>User clicks link and a function is fired off with a parameter that does:</p>

<ul>
<li>create a series of images on a page; defines the onClick event for each image</li>
<li>I then look for one of those elements and performs click() event</li>
</ul>

<p>Problem is, the second function fires too quickly. What I want to do is WAIT for the first function to complete entirely - i.e. wait for all the elements to be created, and THEN fire the click()</p>

<p>I see that the now retired(?) plugin LIVEQUERY used to do that.</p>

<blockquote>
  <p>Live Query also has the ability to fire a function (callback) when it
  matches a  new element and another function (callback) for when an
  element is no longer matched.</p>
</blockquote>

<p>Is there a way to do this this with the new version(s) of jQuery?</p>

<p>Again, I simply want to wait until an element is added to the DOM and then trigger an event on that element.</p>

<p>Any guidance is greatly appreciated.</p>
