classList
The classList property remains consistent with the native implementation. You can use classList to add, remove, and toggle class names.
Here is an example demonstrating how to use classList:
origin text
The classList property lets you easily add, remove, and toggle class names to dynamically change an element’s style.