
点击之后
<p id="test">hello world</p><script>/*style属性cssText -->批量操作csslength (了解)getPropertyValue()item() -->返回对应位置的css属性名removeProperty()setProperty*/var test = document.getElementById("test");test.style.cssText = "color:red;background-color:#333;font-size:14px;";console.log(test.style.getPropertyValue("color"))console.log(test.style)console.log(test.style.item(0))test.onclick = function(){this.style.removeProperty("color")this.style.setProperty("background-color","green")}</script>
