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

How to cancel css style in jquery

青灯夜游
Release: 2023-01-06 11:14:41
Original
3336 people have browsed it

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");
Copy after login

2. Use css() to remove a single css style

Syntax:

$(selector).css("属性","");
Copy after login

Example:

$("#tab1").css("background-color", "");
Copy after login

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!

Related labels:
Statement of this Website
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
Latest Issues
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template