Last active
April 20, 2021 18:14
-
-
Save magbanum/ef286bb67dff238c97e9df8d2eabcfaf to your computer and use it in GitHub Desktop.
Javascript for the dark/light theme switcher
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const btn = document.querySelector(".switch__label"); | |
btn.addEventListener("click", function () { | |
document.body.classList.toggle("dark-theme"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment