jQuery登陆判断简单实现代码
复制代码代码如下所示:$(# txtusername)。焦点(函数(){)
$(# txtusername')瓦迩(‘);
})
$(# txtpassword)。焦点(函数(){)
$(# txtpassword')瓦迩(‘);
})
$(# txtusername)。Blur(function(){)
如果(美元。Val)(# txtusername ')(= =)
{
$(# txtusername)。瓦迩(用户名不为空的);
/焦点
/ / $(' # txtusername ')(重点);
}
})
$(# txtpassword)。Blur(function(){)
如果(美元。Val)(# txtpassword ')(= = {)
$(# txtpassword)。瓦迩(密码不能为空);
}
})
$(# btnsubmit)。Click(function(){)
如果($(' # txtusername)。瓦迩('admin)=(#美元txtpassword)。瓦迩(888888)= =)
{ alert('landing成功!);}
别的{ alert('failed着陆!);}
})
})
用户名 uff1a
uff1a密码