forked from mt-bjtu-practical/Front-end-exercise
-
Notifications
You must be signed in to change notification settings - Fork 0
/
方文正-20271269.html
64 lines (58 loc) · 1.42 KB
/
方文正-20271269.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" >
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>登录页面</title>
<style>
body{
height: 300px;
width: 300px;
background: aqua;
margin: 0 auto;
}
.box{
height: 100px;
width: 300px;
background: aqua;
align-items: center;
text-align: center;
align:center;
}
</style>
<script>
function login()
{
var username = document.getElementById("username").value;
var password = document.getElementById("password").value;
if (username == "fwz" && password == "20271269") {
alert("登录成功")
} else {
alert("用户名或密码错误")
event.preventDefault();
}
}
</script>
</head>
<body >
<div class="box" >
<h1 textAlign: ‘center’ >登录页面</h1>
<p>username:fwz</p>
<p>password:20271269</p>
<div >
<span>
username:
</span>
<input type="text" name="username" id="username">
</div>
<div >
<span>password:</span>
<input type="password" name="password" id="password">
</div>
<div >
<input class="inputButton" type="submit" onclick="login()" value="登录">
</div>
</div>
</body>
</html>