title: Trigger event when dynamically generated image is clicked
body: <p>How do I trigger an event when a dynamically generated image is clicked?</p>
  
  <pre><code>&lt;body&gt;
      &lt;!-- this img element is dynamically generated after page load --&gt;
      &lt;img class="youtube-thumb" src="//i.ytimg.com/vi/x-4KLOsfkHw/hqdefault.jpg"&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>I thought this would work:</p>
  
  <pre><code>$('body').delegate('.youtube-thumb').on('click', function(){
      console.log('hi')
  })
  </code></pre>
  
  <p>But this triggers the event when I click anywhere in the <code>body</code>. What am I doing wrong?</p>