Documentation

Student-friendly HTML, CSS, and JavaScript reference with examples

Sections

classList.remove

Removes a CSS class from an element.

const button = document.querySelector('button');

button.classList.remove('active');
button.classList.remove('highlight', 'large'); // Remove multiple

The element no longer has the class and loses its associated styles.