Created
July 18, 2019 18:51
-
-
Save adrianjguerrero/81fe26122f5a7f9f3e8119e83b62fabd to your computer and use it in GitHub Desktop.
script to toggle between 2 classes using classList API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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