How does jQuery remove blue style classes from matching elements
This article mainly introduces how jQuery removes the blue style class from the matching elements, the content is detailed and easy to understand, the operation is simple and fast, and has a certain reference value. I believe you will gain something after reading this jQuery how to remove the blue style class from the matching elements. Let's take a look.
Starting with jQuery 1.4, the .removeClass () method allows us to specify a function as an argument to return the style to be deleted.
$('li:last') .removeClass (function () {
Return $(this). Prev (). Attr ('class')
})
In the above example, the last style, which is the penultimate style, is removed.
Example:
Example: removes the "blue" style class from the matching elements.
P {margin: 4px; font-size:16px; font-weight:bolder;}
.blue {color:blue;}
.under {text-decoration:underline;}
.highlight {background:yellow;}
Hello
And
Then
Goodbye
$("p:even") .removeClass ("blue")
This is the end of the article on "how jQuery removes blue style classes from matching elements". Thank you for reading! I believe you all have some knowledge of "how jQuery removes blue style classes from matching elements". If you want to learn more, you are welcome to follow the industry information channel.