Skip to content

Instantly share code, notes, and snippets.

@adrianjguerrero
Created July 18, 2019 18:51
Show Gist options
  • Save adrianjguerrero/81fe26122f5a7f9f3e8119e83b62fabd to your computer and use it in GitHub Desktop.
Save adrianjguerrero/81fe26122f5a7f9f3e8119e83b62fabd to your computer and use it in GitHub Desktop.
script to toggle between 2 classes using classList API
function classToggle(el,class1,class2) {
el.classList.toggle(class1);
el.classList.toggle(class2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment