Refactor project
This commit is contained in:
9
inc/js/theme.js
Normal file
9
inc/js/theme.js
Normal file
@@ -0,0 +1,9 @@
|
||||
document.addEventListener('DOMContentLoaded', () =>{
|
||||
const toggleBtn = document.getElementById('darkModeBtn');
|
||||
if(toggleBtn){
|
||||
toggleBtn.addEventListener('click', (e) =>{
|
||||
e.preventDefault();
|
||||
document.body.classList.toggle('dark-mode');
|
||||
})
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user