hasClass Problem

hasClass Problem

Hey, I have a problem with hasClass:

I do the following

  1. if($("input#edit-pass").hasClass("error"))
    $("#register-box").show();
    else if($("input#edit-pass-pass").hasClass("error"))
    $("#login-box").show();




The Problem is, hasClass does not make any differences between
"edit-pass" and "edit-pass-pass". For hasClass this two different classes are the same.

Any ideas?

Thanks

Jan