title: jquery event not working for dynamic elements
body: <p>on click of button i am adding dynamic element eg: anchor tag having some id,
  on clicking the dynamic element alert should open which is not happening.</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script&gt;
  $(document).ready(function(){
  
      $("#submit").on("click",function(){
           $("#op").html("&lt;a href='javascript:void(0)' id='demo'&gt;Click&lt;/a&gt;");
      });
      $("#demo").on("click",function(){
          alert('In Demo....');
      });
  });
  
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;button id="submit"&gt;Submit&lt;/button&gt;
  &lt;pre id='op' &gt;&lt;/pre&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>