Skip to content

Instantly share code, notes, and snippets.

@Huskie
Created January 23, 2014 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Huskie/8581874 to your computer and use it in GitHub Desktop.
Save Huskie/8581874 to your computer and use it in GitHub Desktop.
Plain JavaScript hasClass function
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