Created
February 24, 2015 06:15
-
-
Save tyfkda/8eee0607ec9bcdb7c2cf to your computer and use it in GitHub Desktop.
Add/remove class name to HTML element
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
| // See. http://stackoverflow.com/a/22224493 | |
| // See also. http://caniuse.com/#feat=classlist | |
| elem.classList.add('foobar'); | |
| elem.classList.remove('foobar') | |
| elem.classList.contains('foobar') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment