forked from mt-bjtu-practical/Front-end-exercise
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path禹航-20281162.html
40 lines (39 loc) · 998 Bytes
/
禹航-20281162.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<!DOCTYPE html>
<html>
<head>
<title>Login Form</title>
<style>
</style>
<script>
// 账号密码
var user = "yuhang";
var pass = "yuhang123";
function checkLogin() {
var username = document.getElementById("username").value;
var password = document.getElementById("password").value;
if (username === user && password === pass) {
document.getElementById("loginResult").innerHTML = "登录成功";
} else {
document.getElementById("loginResult").innerHTML = "用户名或密码错误";
}
}
</script>
</head>
<body>
<h1>登录禹航快餐店</h1>
<form>
<div>
<label for="username">用户名:</label>
<input type="text" id="username" name="username">
</div>
<div>
<label for="password">密码:</label>
<input type="password" id="password" name="password">
</div>
<div>
<input type="button" value="登录" onclick="checkLogin()">
</div>
</form>
<div id="loginResult"></div>
</body>
</html>