Created
January 23, 2014 16:35
-
-
Save Huskie/8581874 to your computer and use it in GitHub Desktop.
Plain JavaScript hasClass function
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 hasClass(element, className) { | |
return new RegExp(' ' + className + ' ').test(' ' + element.className + ' '); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment