13 lines
418 B
JavaScript
13 lines
418 B
JavaScript
document.addEventListener('DOMContentLoaded', () => {
|
|
const logoutButton = document.getElementById('logout-button');
|
|
|
|
if (logoutButton) {
|
|
logoutButton.addEventListener('click', () => {
|
|
// Clear the user's session from local storage
|
|
localStorage.removeItem('user');
|
|
// Redirect to the login page
|
|
window.location.href = 'index.html';
|
|
});
|
|
}
|
|
});
|