JavaScript-js改变css样式的3种方式

第一种:使用 cssText 全属性

*.style.cssText = "width: 666px; color: red";

第二种:使用 setProperty(属性名,属性值) 方法

*.style.setProperty("width", "666px");

第三种:直接使用单属性

*.style.width="666px";

猜你喜欢

转载自www.cnblogs.com/reverse201/p/10481604.html
今日推荐