-
Notifications
You must be signed in to change notification settings - Fork 0
/
LS1.html
70 lines (62 loc) · 1.99 KB
/
LS1.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>REVIVE</title>
<link rel="stylesheet" href="LS1.css" />
</head>
<body>
<main id="main-holder">
<h1 id="login-header">Login</h1>
<div id="login-error-msg-holder">
<p id="login-error-msg">
Invalid username
<span id="error-msg-second-line">and/or password</span>
</p>
</div>
<form id="login-form">
<input
type="text"
name="username"
id="username-field"
class="login-form-field"
placeholder="Username"
/>
<input
type="password"
name="password"
id="password-field"
class="login-form-field"
placeholder="Password"
/>
<input type="submit" value="Login" id="login-form-submit" />
</form>
</main>
<script>
const loginForm = document.getElementById("login-form");
const loginButton = document.getElementById("login-form-submit");
const loginErrorMsg = document.getElementById("login-error-msg");
loginButton.addEventListener("click", (e) => {
e.preventDefault();
const username = loginForm.username.value;
const password = loginForm.password.value;
if (username == "admin" && password == "user123") {
window.location.href = "menu1.html";
}
else if(username=="paridhi_jain" && password=="paridhhii"){
window.location.href="menu1.html";
}
else if(username=="varshney_palak"&& password=="varshney"){
window.location.href="menu1.html";
}
else if(username=="khushi_rathi"&& password=="khhushii"){
window.location.href="menu1.html";
}
{
loginErrorMsg.style.opacity = 1;
}
});
</script>
</body>
</html>