jQuery not getting the password field value
<p>I have searched a lot in stackoverflow and other sites and got many solutions but nothing solved mine.That is why I am posting this.I have a password field in my web page, which was created dynamically on a link click.And I want to get the value typed in that password field into a variable when it loses focus.For that i created a jQuery function like this.</p>

<pre><code>$('#parentdiv').on('focusout', '#passwordfield', function() {
      var pass1 = $('#passwordfield').val();
      alert(pass1);
      alert("Hello");
});
</code></pre>

<p>Here the first alert command will displayed with nothing, but the second alert come with "Hello". Which means, when the password field loses its focus this function executes without any problem, but the problem is, it is not getting the password field value.</p>

<p>Please help me to solve this problem.</p>

<p><strong>EDIT</strong></p>

<p>This is my html</p>

<pre><code>&lt;input type="password" size=20 id="passwordfield" /&gt;
</code></pre>
