代码拉取完成,页面将自动刷新
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>index.html</title>
<style>
body {
background-color: whitesmoke;
}
div {
text-align: center;
}
.entrance {
text-decoration: none;
font-size: large;
font-weight: bold;
margin-left: 50px;
margin-right: 50px;
}
.entrance:link, .entrance:visited {
/*color: forestgreen;*/
border-radius: 5px;
background-color: tomato;
color: white;
padding: 12px 18px;
text-align: center;
text-decoration: none;
display: inline-block;
}
#visitor:hover, #visitor:active {
background-color: red;
}
#admin:hover, #admin:active {
background-color: green;
}
#speech:hover, #speech:active {
background-color: blue;
}
</style>
</head>
<body>
<div style="margin-bottom: 30px">
<h1 style="margin-top: 120px">杭州黑马JavaEE_50期学生管理系统</h1>
<br/>
<a class="entrance" id="visitor" href="query">访客模式</a>
<a class="entrance" id="admin"
onclick="/*alert('"管理模式"暂未开放!');*/ document.getElementById('login').style.display='block'" href="#">管理模式</a>
</div>
<div id="login" style="display: none; width: fit-content; margin: auto; padding: 5px; background-color: white;">
<form action="#" method="POST" autocomplete="off">
<div>
<label>账号:
<input type="text" name="username" id="username"/>
</label>
</div>
<div>
<label>密码:
<input type="password" name="password" id="password"/>
</label>
</div>
<div style="margin-top: 5px">
<button type="submit" onclick="validate()">登录</button>
</div>
</form>
</div>
<div style="margin-top: 30px">
<a class="entrance" id="speech" href="speech.html">今日演讲内容</a>
</div>
<script>
function validate() {
let username = document.getElementById("username").value;
let password = document.getElementById("password").value;
if ((username === "admin") && (password === "123456")) {
alert("登录成功!");
} else {
alert("账号或密码错误!");
}
document.getElementById("password").value = "";
}
</script>
</body>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。