Skip to content

Instantly share code, notes, and snippets.

@magbanum

magbanum/script.js

Last active Apr 20, 2021
Embed
What would you like to do?
Javascript for the dark/light theme switcher
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