Home  >  Article  >  Web Front-end  >  How to cancel css style in jquery

How to cancel css style in jquery

青灯夜游
青灯夜游Original
2021-05-20 16:52:503212browse

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.

How to cancel css style in jquery

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn