Cant select ids that I loaded with jQuery
<p>I understand that you need to use ".on" to use code that you loaded with jquery after the page has loaded. (At least I think it works that way)</p>

<p>So I tried that but it somehow just doesn't do a thing at all. No errors in the console either.</p>

<pre><code>$("#forgot_password").click(function(){
  var forgot_password = '&lt;div id="toLogin" style="cursor:pointer;"&gt;Prijava&lt;/div&gt;'
  $("#loginPopupForm").html(forgot_password);                                       
});

$("#toLogin").on("click", function(){
    alert("Hello");
});
</code></pre>

<p>So when I click on #forgot_password it does execute the first click function. But when I click on #toLogin it doesn't do anything and I think its because its loaded with jquery when I click on #forgot_password</p>
