Skip to content

Instantly share code, notes, and snippets.

@pointofpresence
Last active September 27, 2019 08:28
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 pointofpresence/54b97d8a67aab57a66d8555347c7e316 to your computer and use it in GitHub Desktop.
Save pointofpresence/54b97d8a67aab57a66d8555347c7e316 to your computer and use it in GitHub Desktop.
CSS class functions
function addClass(cls) {
this[0].classList.add(cls);
}
function removeClass(cls) {
this[0].classList.remove(cls);
}
function hasClass(cls) {
return this[0].classList.contains(cls);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment