Last active
April 20, 2021 18:14
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