0 votes
1 view
in Web Technology by (22.4k 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.3k 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
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...