Glossary Term
Element.classList
The read-only classList property of the Element interface contains a live DOMTokenList collection representing the class attribute of the element. This can then be used to manipulate the class list.
Using classList is a convenient alternative to accessing an element’s list of classes as a space-delimited string via element.className.
Value: A DOMTokenList object representing the contents of the element’s class attribute. If the class attribute is not set or empty, it returns an empty DOMTokenList, i.e., a DOMTokenList with the length property equal to 0.
Value: Although the classList property itself is read-only in the sense that you can’t replace the DOMTokenList object, you can still assign to the classList property directly, which is equivalent to assigning to its value property. You can also modify the DOMTokenList object using the add(), remove(), replace(), and toggle() methods.
Term Connections
Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.
Loading term connections…
