match the passwords
<p>I have a piece of code for the password match. I want to verify every character with password field while typing in confirm password field.</p>

<pre><code>    var npass = $('#password');
    var rpass = $('#confirmpassword');
    if( npass.val() != rpass.val() ) {
        Val.errors = true;
        Val.showerrors = true;
        $("#confirmpasswordError").html("must match");
        $("#confirmpasswordError").addClass('error-Yes-msg').show();
        $("#confirmpassword").addClass('error-input');
        return false;
    } else {
        $("#confirmpasswordError").removeClass('error-msg').html('');
        $("#confirmpassword").removeClass('error-input');
    }
</code></pre>
