Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Web Technology by (20.3k points)

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.

1 Answer

0 votes
by (40.7k points)

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

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories

...