hasClass() compatible with SVG DOM where SVGAnimatedString is used #468

wants to merge 1 commit into


None yet

2 participants



I'm using Zepto with SVG and it works great so far. Not sure what's the philosophy of Zepto with regards to SVG DOM but I encountered a little issue with hasClass() function which is not compatible with SVG dom.

class in SVG DOM is a SVGAnimatedString with two properties baseVal and animVal where both are of DOMString type. I'm using the baseVal value in my fix to get the proper DOMString.

If you like it, more fixes will come in all places where className is used.


I like it. I would like fixes for all className methods, but with tests of course.

@mislav mislav added a commit that closed this pull request Sep 29, 2012
@mislav mislav support manipulating classnames on SVG elements
Fixes #468
@mislav mislav closed this in 122b014 Sep 29, 2012

All code that touches className now taught SVG. Please review. Thanks!

@lopper lopper added a commit to buddydvd/zepto that referenced this pull request Apr 24, 2013
@mislav mislav support manipulating classnames on SVG elements
Fixes #468
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment