A list of supported CSS selectors when invoking g(..)

來源:互聯網
上載者:User
A list of supported CSS selectors when invoking g(..)

At it's most basic, Gimme is a utility for retrieving lots of elements
quickly and then acting upon all of them at once. This is done through
a call to the g(..) function.
The g(..) function takes one
parameter: a string formatted like a CSS selector which indicates which
elements you want Gimme to retrieve for you.

The following is a list of currently support CSS selectors (more to come);
*(univeral selector) matches any element
E matches ny E element (e.g. an element of type E)
E F matches any F element that is a descendant of an E element
E > F matches any F element that is a direct child of an E element
E + F matches any F element immediately preceded by an E element
E ~ F matches any F element that is a following sibling of an E element
E[foo] matches any E element that has the attribute foo (regardless of its value)
E[foo="warning"] matches any E element whose foo attribute is exactly "warning"
E[foo^="war"] matches any E element whose foo attribute starts with "war"
E[foo$="ing"] matches any E element whose foo attribute ends with "ing"
E[lang|="en"] matches any E element whose lang attribute has a hyphen-separated list of values beginning (from the left) with "en"
E.warning matches any E element that has the class "warning" applied to it
E.warning.severe matches any E element that has both classes "warning" and "severe" applied to it
#id matches any element whose id attribute is exactly id
E#id matches any E element whose id attribute is exactly id
E:first-child matches an E element, first child of its parent
E:last-child matches an E element, last child of its parent
E:nth-child(n) an E element, the n-th child of its parent
TODO:

  1. E[attr|val]
  2. E:enabled
  3. E:disabled
  4. E:checked
  5. E:target
  6. E:not
  7. E:root
  8. E:empty

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.