-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path邓明-20281106.html
85 lines (78 loc) · 2.2 KB
/
邓明-20281106.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<!DOCTYPE html>
<html>
<head>
<title>Login</title>
<style>
.container {
max-width: 300px;
margin: 100px auto;
padding: 20px;
background-color: #fff;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.container h2 {
text-align: center;
margin-bottom: 20px;
}
.input_body {
margin-bottom: 15px;
}
.input_body label {
display: block;
margin-bottom: 5px;
}
.input_body input {
width: 100%;
padding: 8px;
border: 1px solid #ccc;
border-radius: 3px;
}
.btn {
width: 100%;
height: 40px;
background: #ffd100;
color: #222222;
border-radius: 4px;
font-size: 14px;
border: none;
outline: none;
cursor: pointer;
font-weight: 500;
}
</style>
</head>
<body>
<div class="container">
<h2>账号登录</h2>
<div class="input_body">
<label for="username">输入账号:</label>
<input type="text" id="username" required>
</div>
<div class="input_body">
<label for="password">输入密码:</label>
<input type="password" id="password" required>
</div>
<button class="btn" onclick="loginCheck()">Login</button>
</div>
<script>
function loginCheck() {
console.log("123")
var username = document.getElementById("username").value;
var password = document.getElementById("password").value;
// 固定的用户名和密码
var myUsername = "邓明";
var myPassword = "20281106";
if (username === myUsername && password === myPassword) {
alert("登录成功," + myUsername + ",欢迎!")
} else {
alert("登录失败!\n默认用户名为:邓明\n默认密码为:20281106")
}
document.getElementById("username").value = "";
document.getElementById("password").value = "";
}
// const loginBtn = documetn.getElementById("loginBtn");
// loginBtn.addEventListener("click", loginCheck);
</script>
</body>
</html>