jquery validation not working using variables
<p>i'm testing a password confirmation validation.
when im using this code with variables, it doesn't work:</p>

<pre><code>$(function() {
var pass1 = $("#reg-password").val(),
    pass2 = $("#reg-password2").val();
$("#reg-password2").blur(function(){
    if (pass1 != pass2){
        alert ('Doesnt Match');
    }
});
});
</code></pre>

<p>But this one works, why?</p>

<pre><code>$(function() {
$("#reg-password2").blur(function(){
    if ($("#reg-password2").val() != $("#reg-password").val()){
        alert ('Doesnt Match');
    }
});
});
</code></pre>
