问题:
This question already has an answer here: 这个问题在这里已有答案:
- How to change an element's class with JavaScript? 如何用JavaScript更改元素的类? 30 answers 30个答案
Could anyone let me know how to remove a class on an element using JavaScript only? 任何人都可以告诉我如何使用JavaScript删除元素上的类吗? Please do not give me an answer with jQuery as I can't use it, and I don't know anything about it. 请不要给我一个jQuery的答案,因为我不能使用它,我对此一无所知。
解决方案:
参考一: https://stackoom.com/question/92nx/使用JavaScript-无jQuery-从元素中删除CSS类-重复参考二: https://oldbug.net/q/92nx/Remove-CSS-class-from-element-with-JavaScript-no-jQuery-duplicate
来源:oschina
链接:https://my.oschina.net/u/4438370/blog/4422331