密码验证码,但不起作用..我的代码中的错误在哪里?
JS:
function checkPass() {
var pass = document.getElementById('pass');
var pass2 = document.getElementById('pass2');
if(pass != pass2) {
document.layers.passResponse.innerHTML = "Passwords did not Match!";
} else {
document.layers.passResponse.innerHTML = "Passwords Match!";
}
}
HTML:
<div class="form-left">Password * </div>
<div class="form-right"><input type="password" id="pass" name="pass" class="form-input" /></div>
<div class="form-left">Confirm Password *</div>
<div class="form-right"><input type="password" id="pass2" name="pass2" class="form-input" /></div>