👋 Hello! I'm Alphonsio the robot. Ask me a question, I'll try to answer.
How to delete a class in JavaScript?
In JavaScript, the simplest way to remove a class from a given element is to use the method .remove()
on the property .classList
:
var element = document.getElementById('ID');
element.classList.remove('myClass');