In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
This article focuses on "how jquery removes a class". Interested friends may wish to take a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how jquery removes a class.
Removal method: 1, use removeClass () to remove the specified class from the selected element, syntax "element object .removeClass (class name)"; 2, use removeAttr () to remove class attributes from the element, syntax "element object .removeAttr (" class ")".
The operating environment of this tutorial: windows7 system, jquery1.10.2 version, Dell G3 computer.
Jquery removes a class
Method 1: use removeClass ()
The removeClass () method removes one or more classes from the selected element.
$(selector) .removeClass (class)
Note: if no parameters are specified, the method removes all classes from the selected element.
Example:
$(document) .ready (function () {$("button") .click (function () {$("p:first"). RemoveClass ("intro");}) .intro {font-size: 120%; color: red } this is a paragraph title. This is a paragraph.
This is another paragraph.
Remove the "intro" class of p element
Method 2: use removeAttr ()
The removeAttr () method removes attributes from the selected element.
Simply use this method to remove the class attribute from the selected element to remove the class
$(selector) .removeAttr ("class")
Example:
$(document) .ready (function () {$("button") .click (function () {$("p:first"). RemoveAttr ("class");}) .intro {font-size: 120%; color: red } this is a paragraph title. This is a paragraph.
This is another paragraph.
Remove the class of the p element
At this point, I believe you have a deeper understanding of "how jquery removes a certain class". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.