Created
September 16, 2017 13:57
-
-
Save electerious/9399d130b0ade5cbfaa9f537fbc06b8a to your computer and use it in GitHub Desktop.
Checks if an element has any of multiple classes
This file contains hidden or 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
const hasClassNames = (elem, classNames) => classNames.filter((className) => elem.classList.contains(className)).length>0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example: