Skip to content

Instantly share code, notes, and snippets.

@vanaf1979
Last active March 1, 2021 11:30
Show Gist options
  • Save vanaf1979/cc86fa5a6de50d08bbb28f2e21a1f7e9 to your computer and use it in GitHub Desktop.
Save vanaf1979/cc86fa5a6de50d08bbb28f2e21a1f7e9 to your computer and use it in GitHub Desktop.
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