Basic selector

1.* selectors such as $(” * “)
2. Group selectors such as $(” ul Li “)
3. Id selector such as $(” #box “)
4. Tag selectors such as $(” A “)
5. Category selectors such as $(“.box “)

Two. Level selector

1. Lineal descendant selector $(” div>p “)
2. The next adjacent sibling element is:
( . f i r s t + l i ) or Or (. First + li)
(” first “). The next (” li “)
3. All the following adjacent siblings are as follows:
( . f i r s t   l i ) or Or (“. First ~ li “)
(” first “). NextAll (” li “)

Filter selector

1. Basic filter selector

1) :first select the first element like :$(” p:first “)
2) :last Select the last element such as $(” p:last “)
3) :not…. Elements such as $(” a:not(.active) “)
4) :even and :odd (select index from 0, even, odd)
( l i : o d d ) . (li:odd),
(li:even )
$(” p:eq(3) “)
6) :gt(x) and lt(x)(take the element greater than or equal to the x index) e.g. $(” p:gt(0) “) the element greater than the first p
7) :header (select h1 to H6 header elements) such as $(” :header “)

2. Content filtering selector

$(” a:contains(href) “) :contains(href)
$(” p:empty “) :$(” p:empty “)
$(” li:has(a) “) $(” li:has(a) “)

3. Visibility filter selector

1) :hidden Select all invisible elements or elements whose type is hidden as follows:
( d i v : h i d d e n ) . (” div: hidden “),
(” input: hidden “)
2) :visible selects all visible elements like
( : v i s i b l e ) . (the “visible”),
Opacity =0/visibility:hidden (” div:visible “) Only display: None /input type=”hidden” works,opacity=0/visibility:hidden does not work

4. Attribute filter selector

$(div[id]) select all div tags with the id attribute
And 2) [attrible = value]attrible! =valueSuch as:
( a [ t i t l e = l i n k ] ) (” a [title = link] “)
(” A [title!=link] “) selects all a elements whose title attribute is link
3)[attrible^=value],[attrible
= v a l u e ] and [ a t t r i b l e = v a l u e ] / The attribute value to v a l u e Began to v a l u e End, or contain v a l u e The value of such as : =value] and [attrible*=value] / attribute values start with value, end with value, or contain value such as:
(“a[class^=hot]”) $(“a[class*=h]”)
4) Arbitrary combination of compound selectors such as:
( a [ c l a s s = h o t ] [ c l a s s (“a[class^=hot][class
=country]”)

4. Child element filter selector

$(“li:first-child”); $(“li:first-child”);
$(“p:only-child”) $(“p:only-child”)
3) the NTH – child (x)/NTH – child (even/odd)/NTH – child (x + y) such as: $(” div: NTH – the child (1) “)

5. Form attribute filter selector

1)enabled和disabled(取可用或不可用元素) input Textarea select… 如:
( e n a b l e d ) (“enabled”)
(“disabled”)
2) : Checked checked radio or check buttons like:
( : c h e c k e d ) (“:checked”)
(“input[type=radio]”)
$(“:selected”)

Four. Form selector

1: submit such as: $(” : submit “)
2. : the button such as: $(” : the button “)
(3) : the file such as: $(” : the file “)
4. : reset, such as: $(” reset “)
5. : password such as $(” : “password,” “)
6. : radio, such as: $(” : radio “)
7. : the checkbox, such as: $(” : the checkbox “)
8. : hidden, such as: $(” hidden “)
9. : text, such as: $(” : text “)