Skip to content

Instantly share code, notes, and snippets.

@jjmu15
Created January 31, 2014 09: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 jjmu15/8728955 to your computer and use it in GitHub Desktop.
Save jjmu15/8728955 to your computer and use it in GitHub Desktop.
add class - vanilla js
if (el.classList)
el.classList.add(className)
else
el.className += ' ' + className
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment