Created
January 8, 2015 17:53
-
-
Save ethanclevenger91/7d38a3cf78e74b3e1003 to your computer and use it in GitHub Desktop.
SVG class manipulation - no IE9 support
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
$('svg.foo').click(function() { | |
this.classList.toggle('selected'); | |
}); | |
//classList supports add(), remove(), toggle() and contains() | |
//No IE9 support - shim here - https://developer.mozilla.org/en-US/docs/Web/API/Element.classList |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment