Home >

CSS selectors syntax supported by jQuery

3. March 2011

Following is the list of basic CSS selectors supported by jQuery

* Matches any element.

E Matches all element with tag name E.

E F Matches all elements with tag name F that are descendents of E.

E>F Matches all elements with tag name F that are direct children of E.

E+F Matches all elements F immediately preceded by sibling E.

E~F Matches all elements F preceded by any sibling E.

E:has(F) Matches all elements with tag name E that have at least one descendent with tag name F.

E.C Matches all elements E with class name C. Omitting E is the same as *.C.

E#I Matches element E with id of I. Omitting E is the same as *#I.

E[A] Matches all elements E with attribute A of any value.

E[A=V] Matches all elements E with attribute A whose value is exactly V.

E[A^=V] Matches all elements E with attribute A whose value begins with V.

E[A$=V] Matches all elements E with attribute A whose value ends with V.

E[A*=V] Matches all elements E with attribute A whose value contains V.

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading