<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>马超之勇不亚于吕布的博客</title>
<script src="../jquery/jquery.js"></script>
</head>
<body>
<div id="div09">
<p>账号:<input id="userName" type="text"></p>
<p>密码:<input id="password" type="password"></p>
<p><button type="button">提交</button></p>
</div>
<script>
$(":button").on('click',function(){
var name = $('[type=text]').val();
var pwd = $('[type=password]').val();
if(name.length==0){
alert("你输入的不能为空")
}
if(pwd.length<6){
alert("你输入的长度不可以少于6位")
}
});
</script>
</body>
</html>
jquery验证登陆
最新推荐文章于 2024-06-04 15:23:15 发布