Home >Web Front-end >JS Tutorial >jQuery group selector usage example_jquery

jQuery group selector usage example_jquery

WBOY
WBOYOriginal
2016-05-16 16:24:481208browse

The example in this article describes the usage of jQuery group selector. Share it with everyone for your reference. The specific analysis is as follows:

The grouping selector combines the elements matched by each selector and returns them together, and can perform the same operation on them.

Example code:

Copy code The code is as follows:
$(".mydiv ,span")

The above code can match elements with the class name mydiv and all span elements. The two selectors must be separated by commas.
Example code:

Copy code The code is as follows:






Script Home





Script Home

Script House welcomes you



The above code can set the font color in the div and span with the class name mydiv to red.

I hope this article will be helpful to everyone’s jQuery programming.

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