<input id="username" ><span style="color:red;display:hidden">用户名由..</span>
<br/>
<input id="password"><span style="color:red;display:hidden">密码由...</span><script>
$(function(){
$("#username").blur(function(){
var username = $(this).val();//用户名
if(用户名错误){
$(this).next().show();
}else{
$(this).next().hide();
}
});
$("#password").blur(function(){
var pwd= $(this).val();//密码
if(密码错误){
$(this).next().show();
}else{
$(this).next().hide();
}
});
});
</scrpit>
温馨提示:内容为网友见解,仅供参考