Back

The classList Property

About

The classList property is defined on HTMLElements and is an object which allows one to cleanly modify which classes apply to an element rather than by directly modifying the className property.

classList is of type DOMTokenList, which can be manipulated by the following methods.

References

  1. https://developer.mozilla.org/en/DOM/element.classList
  2. https://developer.mozilla.org/en/DOM/element.className
  3. http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#dom-classlist