展示
代码
JS代码:
$(function(){
$("input[type='password']").blur(function(){
var id = $(this).attr("id"), v = $(this).val();
if(v === ""){
$("#" + id + "_span").text("密码不能为空!");
$(this).css("background-color","#ffffe0");
}else{
if(id === "pwd2" && v!== $("#pwd").val()){
$("#" + id + "_span").text("前后密码不一致!");
$(this).css("background-color","#ffffe0");
}else{
$("#" + id + "_span").text("*");
}
}
$("#box").htmlcode($("#show"));
});
$("input[type='password']").focus(function(){
$(this).css("background","white");
$("#box").htmlcode($("#show"));
});
$("#box").htmlcode($("#show"));
});