Back
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.
You can try using classList as it is widely supported in the latest version of most modern browsers:
ELEMENT.classList.remove("CLASS_NAME");
For more information refer to this document: https://developer.mozilla.org/en/DOM/element.classList
31k questions
32.8k answers
501 comments
693 users