-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
35 lines (29 loc) · 1.19 KB
/
Copy pathscript.js
File metadata and controls
35 lines (29 loc) · 1.19 KB
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
document.addEventListener('DOMContentLoaded', function () {
const loginBtn = document.getElementById('loginBtn')
const loginModal = document.getElementById('loginModal')
const closeBtn = document.getElementById('closeBtn')
loginBtn.addEventListener('click', function () {
loginModal.style.display = 'block'
})
closeBtn.addEventListener('click', function () {
loginModal.style.display = 'none'
})
window.addEventListener('click', function (event) {
if (event.target === loginModal) {
loginModal.style.display = 'none'
}
})
const loginSubmitBtn = document.getElementById('loginSubmitBtn')
loginSubmitBtn.addEventListener('click', function () {
const enteredUsername = document.getElementById('loginUsername').value
const enteredPassword = document.getElementById('loginPassword').value
// Check if the entered username and password are correct
if (enteredUsername === 'sManager' && enteredPassword === '123') {
// Redirect to the dashboard page
window.location.href = 'ui-elements.html'
} else {
// Display an error message (you can customize this part)
alert('Invalid username or password. Please try again.')
}
})
})