Home >Web Front-end >JS Tutorial >How to delete css in jquery
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.
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!