set CSS style in js solutions All In One
css in js
- set each style property separately
- set all style properties in once
- set all style properties in one class, with
setAttribute
API
- set all style properties in one class, with
classList
API
refs
https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttribute
https://developer.mozilla.org/en-US/docs/Web/API/Element/classList
https://stackoverflow.com/a/64693372/5934465
©xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!