Could anyone let me know how to remove a class on an element using JavaScript only?
Please do not give me an answer with jQuery as I can’t use it, and I don’t know anything about it.
Could anyone let me know how to remove a class on an element using
Share
The right and standard way to do it is using
classList. It is now widely supported in the latest version of most modern browsers:Documentation: https://developer.mozilla.org/en/DOM/element.classList