Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
const box = document.querySelector(".box");
const toggleButton = document.querySelector('#toggleClass');
toggleButton.addEventListener('click', () => {
box.classList.toggle("active");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment