Skip to content

Instantly share code, notes, and snippets.

@wpflames
Created September 9, 2020 06:47
Show Gist options
  • Select an option

  • Save wpflames/06a68e937b260733009962ae1ef4b3a6 to your computer and use it in GitHub Desktop.

Select an option

Save wpflames/06a68e937b260733009962ae1ef4b3a6 to your computer and use it in GitHub Desktop.
JavaScript toggle to add “active” class
function toggle(){
var button = document.getElementById('btn-toggle');
button.classList.toggle('active');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment