remove method of the classList object

The remove method of the classList object removes a given CSS class of an element.

Syntax

javascriptelement.classList.remove(class);

Example

We remove the class ggg:

html<p id="elem" class="www ggg zzz"></p>
javascriptlet elem = document.querySelector('#elem');
elem.classList.remove('ggg');

The code execution result:

html<p id="elem" class="www zzz"></p>

See also