-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
39 lines (29 loc) · 1009 Bytes
/
script.js
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
let form = document.getElementById('login-form')
// add event listener at form
form.addEventListener('submit',function(event){
event.preventDefault();
let username = document.getElementById('username').value;
var password = document.getElementById('pass-word').value;
if (username === 'admin' && password === 'nintriva') {
alert('Login successful!');
// Redirect to the logged-in page
} else {
let error = document.getElementById('error-msg');
error.style.display = "block";
}
})
// set eventlistener at icon and inbox
let user = document.getElementById('user-input');
let password = document.getElementById('pass-input');
user.addEventListener('click', ()=>{
user.style.borderBottom = "1px solid #1d95cf";
setTimeout(() => {
user.style.borderBottom = "";
},100);
});
password.addEventListener('click', ()=>{
password.style.borderBottom = "1px solid #1d95cf";
setTimeout(() => {
password.style.borderBottom = "";
},100);
});