forked from mt-bjtu-practical/Front-end-exercise
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path赵洪杰-20281264.html
62 lines (56 loc) · 1.5 KB
/
赵洪杰-20281264.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<!DOCTYPE html>
<html>
<head>
<title>登录页面</title>
<style>
.container {
width: 300px;
margin: 0 auto;
padding-top: 100px;
}
.input-field {
margin-bottom: 20px;
}
.input-field label, .input-field input {
display: block;
}
.btn-container {
text-align: center;
}
.btn {
padding: 10px 20px;
background-color: #4CAF50;
color: #fff;
border: none;
cursor: pointer;
}
</style>
</head>
<body>
<div class="container">
<div class="input-field">
<label for="username">账号:</label>
<input type="text" id="username">
</div>
<div class="input-field">
<label for="password">密码:</label>
<input type="password" id="password">
</div>
<div class="btn-container">
<button class="btn" onclick="login()">登录</button>
</div>
</div>
<script>
function login() {
var username = document.getElementById("username").value;
var password = document.getElementById("password").value;
// Check if username and password match the requirements
if (username === "20281264" && password === "1111") {
alert("登录成功");
} else {
alert("登录失败");
}
}
</script>
</body>
</html>