基于JQ的登录界面实现 - 邓诗的登录示例
<!DOCTYPE html>
<html>
<head>
<title>登录界面 - 邓诗示例</title>
<meta charset="utf-8">
<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#submitBtn").click(function(){
var name = $("#name").val();
var password = $("#password").val();
if(name == '邓诗' && password == '21100011'){
$("#loginStatus").text(name + ',登录成功!');
}else{
alert('用户名或密码错误!');
}
});
});
</script>
</head>
<body>
<div>
<label for="name">姓名:</label>
<input type="text" id="name" name="name">
</div>
<div>
<label for="password">密码:</label>
<input type="password" id="password" name="password">
</div>
<button id="submitBtn">提交</button>
<div id="loginStatus"></div>
</body>
</html>
原文地址: https://www.cveoy.top/t/topic/opf2 著作权归作者所有。请勿转载和采集!