This page is In Progress

Notice: The WebPlatform project has been discontinued when the Stewards partnership agreement ended in September 2015. This site has been frozen, and the assets we have created will remain.

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