title: JQuery add on(load) event to dynamically created elements
body: <p>I'm building a page that dynamically loads content coming from a database.
  After the content is loaded, I would like an event to be triggered to perform some actions.</p>
  
  <p>I can't use the window.onload event because that one fires when the initial page is loaded, before the content is being added.</p>
  
  <p>I've been trying to add a load command to the variable I'm appending to my div but it doesn't fire.</p>
  
  <p>I'm assuming I'm forgetting something stupid, but I can't find what.</p>
  
  <pre><code>  var html = '&lt;div class="messageContent"&gt;&lt;img src="http://www.microadagencies.com/wp-content/uploads/2015/08/Dont-be-Evil-by-Google.jpg" /&gt;&lt;/div&gt;\r\n';
  
    var objToAppend = $(html).on('load', function() {
      alert('loaded')
    });
  
    $('#test').append(objToAppend);
  </code></pre>
  
  <p>Can anybody spot what I'm doing wrong?</p>
  
  <p>JSFiddle: <a href="https://jsfiddle.net/215yuxyk" rel="nofollow noreferrer">https://jsfiddle.net/215yuxyk</a></p>