-
Notifications
You must be signed in to change notification settings - Fork 0
Selectors
atk edited this page Jun 14, 2011
·
5 revisions
tiny.js features full CSS2.1 selectors - and the irregular parent(s) selectors "<" and "<<". Multiple selectors in one selection as well as multiple selections, splitted with ",", are possible.
The Selector engine has a small optimization regarding basic selectors that can be covered with the DOM-getElement-Methods.
t('body')
will select every Node with the given tagname, e.g. 'body' or even '*'.
t('.text')
selects all Nodes with the className 'text'.
t('#header')
returns the Node with the id 'header'.
t('[name=password]')
scrounges the document for all Nodes with the name 'password'.
Traversing shorthands like ~, +, > are also implemented, but less optimized.