classList

The classList JS Element allows for manipulation of element’s class content attribute as a set of whitespace-separated tokens through a DOMTokenList object.

Syntax

element.classList

Examples

1 · return

2 · remove

3 · add

4 · toggle

5 · replace

6 · contains

7 · item

8 · [ ]

HomeMenu