Home > Article > Web Front-end > Compatible writing method of addRule under firefox_javascript skills
There are really many ways to use scripts to control the style of html elements.
For a single element, you can directly use element.style.display=... to modify one style, or you can use element.className=... to modify its multiple styles.
To modify the styles of multiple elements, you can use scripts to directly import css files.
There is such a requirement in the current project. It is required to change the style of all descendant nodes under a certain div, but not change the style of the div itself.
I left the code without thinking: