Modern browsers provide a classList object to ease manipulation of the element's class attribute. Older browsers require direct manipulation of the element's className property.
W3C DOM4
A simple method to add a class to an element is to append it to the end of the className property. This will no...
Modern browsers provide a classList object to ease manipulation of the element's class attribute. Older browsers require direct manipulation of the element's className property.
* Note class names are not stored in the element's property in any particular order
W3C DOM4
Removing one class from an...
Modern browsers provide a classList object to ease manipulation of the element's class attribute. Older browsers require direct manipulation of the element's className property.
* Note class names are not stored in the element's property in any particular order
W3C DOM4
Testing if an element cont...