This page is In Progress

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

classList

Summary

Reflects the class attribute as an ordered list of the whitespace separated class names and has convenience methods for add, remove, contains and more.

Property of dom/Elementdom/Element

Syntax

Note: This property is read-only.

var classList = element.classList;

Return Value

Returns an object of type

A DOMTokenList representing the class names of the element.

Related specifications

WHATWG DOM
Living Standard
DOM4
Working Draft

See also

Related pages

Attributions