[JQuery]CSS

What follows is a list of supported CSS Selector expressions.

  • * any element
  • E an element of type E
  • E:root an E element, root of the document
  • E:nth-child(n) an E element, the n-th child of its parent
  • E:first-child an E element, first child of its parent
  • E:last-child an E element, last child of its parent
  • E:only-child an E element, only child of its parent
  • E:empty an E element that has no children (including text nodes)
  • E:enabled
  • E:disabled a user interface element E which is enabled or disabled
  • E:checked a user interface element E which is checked (for instance a radio-button or checkbox)
  • E.warning an E element whose class is "warning"
  • E#myid an E element with ID equal to "myid".
  • E:not(s) an E element that does not match simple selector s
  • E F an F element descendant of an E element
  • E > F an F element child of an E element
  • E + F an F element immediately preceded by an E element
  • E ~ F an F element preceded by an E element

Supported, but different

All attribute selectors are written like their XPath counter-parts (in that all attributes should begin with an @ symbol).

  • E[@foo] an E element with a "foo" attribute
  • E[@foo=bar] an E element whose "foo" attribute value is exactly equal to "bar"
  • E[@foo^=bar] an E element whose "foo" attribute value begins exactly with the string "bar"
  • E[@foo$=bar] an E element whose "foo" attribute value ends exactly with the string "bar"
  • E[@foo*=bar] an E element whose "foo" attribute value contains the substring "bar"

Not supported

jQuery only supports selectors that actually select DOM elements - everything else is ignored.

  • E:link
  • E:visited an E element being the source anchor of a hyperlink of which the target is not yet visited (:link) or already visited (:visited)
  • E:active
  • E:hover
  • E:focus an E element during certain user actions
  • E:target an E element being the target of the referring URI
  • E::first-line the first formatted line of an E element
  • E::first-letter the first formatted letter of an E element
  • E::selection the portion of an E element that is currently selected/highlighted by the user
  • E::before generated content before an E element
  • E::after generated content after an E element

jQuery doesn't support the following selectors due to their lack of real-world usefulness:

  • E:nth-last-child(n) an E element, the n-th child of its parent, counting from the last one
  • E:nth-of-type(n) an E element, the n-th sibling of its type
  • E:nth-last-of-type(n) an E element, the n-th sibling of its type, counting from the last one
  • E:first-of-type an E element, first sibling of its type
  • E:last-of-type an E element, last sibling of its type
  • E:only-of-type an E element, only sibling of its type
  • E:lang(fr) an element of type E in language "fr"
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值