Deletion method: 1. Use removeClass() or toggleClass() to remove the specified CSS class, the syntax is "removeClass("class name")" or "toggleClass("class name")"; 2. Use removeAttr ()Remove id, class or style attributes.
The operating environment of this tutorial: windows7 system, jquery1.10.2 version, Dell G3 computer.
How to delete css style in jquery:
1. Use removeClass() or toggleClass() to remove the specified CSS class
removeClass() - Remove CSS class
1 2 3 |
|
toggleClass() - Add or remove CSS class
If the CSS class already exists, it will is removed; instead, if the CSS class does not exist, it will be added.
1 2 3 |
|
2. Use removeAttr() to remove id, class or style attributes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
(Learning video sharing: css video tutorial)
The above is the detailed content of How to delete css style using jq. For more information, please follow other related articles on the PHP Chinese website!