Learn HTML DOM
Manipulating DOM Elements
4.8
Lesson

Removing Class from an Element

We can add class values to an element using the classList property.

The classList property returns a list of all the class attributes of the element. We then remove class names separated by commas from this list using the remove method on the classList property.