Skip to content

Document change in addClass/removeClass for jQuery 3 #814

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
AurelioDeRosa opened this issue Oct 8, 2015 · 5 comments
Closed

Document change in addClass/removeClass for jQuery 3 #814

AurelioDeRosa opened this issue Oct 8, 2015 · 5 comments
Assignees
Milestone

Comments

@AurelioDeRosa
Copy link
Member

jQuery 3 changes the behavior of addClass/removeClass for better SVG support. Thanks you @gibson042 for the feedback.

@AurelioDeRosa AurelioDeRosa self-assigned this Oct 8, 2015
@AurelioDeRosa AurelioDeRosa added this to the 3.0.0 milestone Oct 8, 2015
@dmethvin
Copy link
Member

dmethvin commented Oct 8, 2015

Something like this paragraph might work:

In HTML documents only, browsers keep the class attribute (e.g. $(elem).attr("class") or elem.getAttribute("class") and the className property (e.g. $(elem).prop("className") or elem.className) in sync; when you change one of them the browser updates the other. Prior to jQuery 3.0, jQuery used the className property in addClass and removeClass, which is not compatible with XML or SVG documents. As of jQuery 3.0, the class attribute is used instead and these methods can be used on XML or SVG.

@AurelioDeRosa
Copy link
Member Author

Fixed with commit 4651f44.

@timmywil
Copy link
Member

Will be added in 1.12/2.2. 9bf0ad3

@AurelioDeRosa
Copy link
Member Author

Thank you for that @timmywil. Should I include it in the main branch once we release 1.12/2.2?

@timmywil
Copy link
Member

Yup, I'm trying to get the branch to point where it can be merged on release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants