100-project-100-days-website/100_projects/8-light-&-dark-theme-toggle/main.js

6 lines
149 B
JavaScript
Raw Normal View History

2023-03-01 17:21:02 +03:00
const checkbox = document.getElementById('checkbox');
checkbox.addEventListener('change', () => {
document.body.classList.toggle('dark');
});