title: Click event doesn't work after append
body: <p>I want to dynamic click on first click of paragraph but its not working.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function() {
    $(".newclass").click(function() {
      var append_code = '&lt;a href="google.com" class="hrefclick"&gt;Youre clicked&lt;/a&gt;';
      $('body').append(append_code);
      $(".hrefclick").click();
  
      $(document).on('click', '.hrefclick', function(e) {
        alert("yess! You're clicked");
        // do whatever
      });
    });
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;p class="newclass"&gt;
    Hit me!
  &lt;/p&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><a href="https://jsfiddle.net/rushil_pachchigar/d8yn716t/9/" rel="nofollow noreferrer">js Fiddle</a></p>