如何使用jquery移除CSS样式

html-css011

如何使用jquery移除CSS样式,第1张

如果你想移除指定的样式的话 你完全可以重新设置他的样式

比如你想他最终的style为color:red的话

你直接写

$("#msg5 .syzx >span:first").attr("style",{"color":"red"})

如果完全不要就可以使用$("#msg5 .syzx >span:first").removeAttr("style")

或者写成$("#msg5 .syzx >span:first").attr("style",“”)

如果你想移除指定的样式的话

你完全可以重新设置他的样式

比如你想他最终的style为color:red的话

你直接写

$("#msg5

.syzx

>

span:first").attr("style",{"color":"red"})

如果完全不要就可以使用$("#msg5

.syzx

>

span:first").removeattr("style")

或者写成$("#msg5

.syzx

>

span:first").attr("style",“”)