-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
26 lines (20 loc) · 935 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
document.getElementById('loginForm').addEventListener('submit', function(event) {
event.preventDefault();
const username = document.getElementById('username').value;
const password = document.getElementById('password').value;
const messageElement = document.getElementById('message');
if (username === 'admin' && password === 'password') {
messageElement.style.color = 'green';
messageElement.textContent = 'Login successful!';
window.location.href = 'project interface2.html';
}
else if (username === 'admin1' && password === 'password1') {
messageElement.style.color = 'red';
messageElement.textContent = 'login succesful!';
window.location.href = 'project interface2.html';
}
else {
messageElement.style.color = 'red';
messageElement.textContent = 'Invalid username or password.';
}
});