Last active
December 28, 2015 18:19
-
-
Save yanbab/7542073 to your computer and use it in GitHub Desktop.
Pure javascript add/remove/toggle class on an element - Needs a shim on IE8/9 : https://github.com/eligrey/classList.js or https://gist.github.com/devongovett/1381839
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
document.getElementById('id').classList.add('class'); | |
document.getElementById('id').classList.remove('class'); | |
document.getElementById('id').classList.toggle('class'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment