title: jQuery click handler function does not fire on element added after DOM load
body: <p>I believe I could do this with .live but that method is deprecated. Here's the issue:</p>
  
  <p>I have a click handler function that should fire on any element with the class "myClickEl" for example. This works fine on "myClickEl" elements that are present in the document at the time its loaded. However, if I add a myClickEl element after the DOM has loaded, the click handler does not fire.</p>
  
  <p>Here's the code. I've tried both methods below:</p>
  
  <p>Option 1:</p>
  
  <pre><code>    jQuery('.myClickEl').on('click', function(){
          var formText='This is some text to paste';
          jQuery(this).parent().next('textarea').val('');
          jQuery(this).parent().next('textarea').val(formText);
      });
  </code></pre>
  
  <p>Option 2:</p>
  
  <pre><code>    jQuery('.myClickEl').click(function(){
          var formText='This is some text to paste';
          jQuery(this).parent().next('textarea').val('');
          jQuery(this).parent().next('textarea').val(formText);
      });
  </code></pre>