Home >Web Front-end >JS Tutorial >How to cancel css style in jquery
Jquery method to cancel css style: 1. Use the "$(selector).removeAttr("style");" statement to remove all css styles; 2. Use the "$(selector).css(" attribute The ","");" statement removes a single css style.
The operating environment of this tutorial: windows7 system, jquery1.10.0 version, Dell G3 computer.
jquery cancel css style
1. Use removeattr() to remove all css styles
Syntax:
$(selector).removeAttr("style");
2. Use css() to remove a single css style
Syntax:
$(selector).css("属性","");
Example:
$("#tab1").css("background-color", "");
Related video tutorial recommendations: jQuery Tutorial (Video)
The above is the detailed content of How to cancel css style in jquery. For more information, please follow other related articles on the PHP Chinese website!