2. The next adjacent sibling element is: (.first+li)or(” first “). The next (” li “)
3. All the following adjacent siblings are as follows: (“.firstli“)or(” 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) (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: (“div:hidden“).(” input: hidden “)
2) :visible selects all visible elements like (“: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[title=link]“)(” A [title!=link] “) selects all a elements whose title attribute is link
3)[attrible^=value],[attrible =value]and[attrible∗=value]/Belong tosexvalueIn order tovalueopenbeginning.In order tovalue“beam.orpackagecontainingvaluethevalueSuch as:(“a[class^=hot]”) $(“a[class*=h]”)
4) Arbitrary combination of compound selectors such as: (“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) “)