Only on versions 2 Utile 2
It's important to note that this method does not replace a class. It simply adds the class, appending it to any which may already be assigned to the elements.
Before jQuery version 1.12/2.2, the .addClass()
 method manipulated the className
 property of the selected elements, not the class
 attribute. Once the property was changed, it was the browser that updated the attribute accordingly. An implication of this behavior was that this method only worked for documents with HTML DOM semantics (e.g., not pure XML documents).
As of jQuery 1.12/2.2, this behavior is changed to improve the support for XML documents, including SVG. Starting from this version, the class
 attribute is used instead. So, .addClass()
 can be used on XML or SVG documents.