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

How to delete css in jquery

藏色散人
藏色散人Original
2021-04-02 14:08:332226browse

Jquery method to delete css: first open the corresponding code file; then assign the css attribute value to empty through the "$('.div1').css('opacity','');" method Can.

How to delete css in jquery

The operating environment of this article: Windows 7 system, jquery version 3.2.1, DELL G3 computer

Simple method to delete css attributes with Jquery

Sometimes when we don’t need a certain css attribute, we want to delete it, but is there a removeCss method? What should we do?

You can use the following method to solve

$('selector').css('css attribute','');

About css If the attribute value assignment is empty, the css attribute will not be displayed on the page.

For example: $('.div1').css('opacity','');

Recommended learning: "jquery video tutorial

The above is the detailed content of How to delete css 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