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 any 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="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.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

TODO:

  1. E:nth-child()
  2. E:first-child
  3. E[attr~val]
  4. E[attr
  5. E[attrval]
  6. E:enabled
  7. E:disabled
  8. E:checked
  9. E:target
  10. E:not
  11. E:root
  12. E:empty

Last edited May 16, 2007 at 11:33 PM by sstchur, version 9

Comments

No comments yet.