10 lines
244 B
JavaScript
10 lines
244 B
JavaScript
|
let body = document.querySelector('body');
|
||
|
let dark = document.querySelector('#dark');
|
||
|
|
||
|
dark.onclick = function (){
|
||
|
if(dark.checked == true){
|
||
|
body.classList.add('darkMode');
|
||
|
} else {
|
||
|
body.classList.remove('darkMode');
|
||
|
}
|
||
|
}
|