点击之后
<p id="test">hello world</p>
<script>
/*
style
属性
cssText -->批量操作css
length (了解)
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>