原生JS读写CSS样式的方法
发布日期:2020-11-25
通过Element对象的getAttribute()、setAttribute()、removeAttribute()直接读写style属性 如:elm.setAttribute('style','color:red;line-height:30px'); 利用document.styleSheets属性,返回当前页面...
发布日期:2020-11-25
通过Element对象的getAttribute()、setAttribute()、removeAttribute()直接读写style属性 如:elm.setAttribute('style','color:red;line-height:30px'); 利用document.styleSheets属性,返回当前页面...