1 2 3 4 5 6 7 8 9 10 | document.getElementById( "checkPwd" ).addEventListener( "focus" , checkPwd);
document.getElementById( "checkPwd" ).addEventListener( "blur" , checkPwd); function checkPwd(){
if (!$( "#checkPwd" ).val()){
$( "#checkPwdMsg" ).text( "请输入确认密码" ).show();
} else if ($( "#pwd" ).val() != $( "#checkPwd" ).val()){
$( "#checkPwdMsg" ).text( "两次密码输入不一致" ).show();
} else {
$( "#checkPwdMsg" ).text( "" ).show();
}
}
|
登录后复制
以上是如何用js实现再次确认密码功能的详细内容。更多信息请关注PHP中文网其他相关文章!