12 Types of jquery selectors1, #id: Match an element according to the given ID
Display (with bold instead of color):
This is the first P tag
2, *: Matching all elements, more used in conjunction with the context to search
Show:
This is the P tag
This is the div tag.
3, Multi-selector Selector1,selector2,selectorn: Specify any number of selectors, and merge the matched elements into one result
Show:
This is the second P tag
This is the first div tag
This is a second div tag
4. Ancestor descendant: matches all descendant elements under a given ancestor element
This is the first span tag
This is the second span tag
5, Prev + Next: Matches all next elements immediately following the Prev element
6, Prev ~ siblings: All siblings sibling elements after matching the prev element
This is the third P tag
7.: First: Get the element one
8: Not (selector): Removes all elements that match the given selector
9.: even: Matches all elements with an even number of index values, starting from 0 counts
This is the P-label with an index value of 0
This is the P-label with an index value of 1
This is the P-label with an index value of 2
This is the P-label with an index value of 3
10.: Odd: Matches all elements with an odd index value, counting from 0
11,: Last (): Get final element
12: GT (Index): matches all elements greater than the given index value
12 Types of jquery selectors