//检查俩次密码输入是否一致 function check_pass(thisObj) { var psw = document.getElementById('pass'); if (psw.value.length == 0) { document.getElementById('show_pass').innerHTML = "密码不能为空"; return false; } else { document.getElementById('show_pass').innerHTML = ""; if (thisObj.value != psw.value) { document.getElementById('show_repass').innerHTML = "两次密码输入不正确"; return false; } document.getElementById('show_repass').innerHTML = ""; return true; } }