Skip to content
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.

Basic Selectors

The Selector engine has a small optimization regarding basic selectors that can be covered with the DOM-getElement-Methods.

tag Selector

t('body') will select every Node with the given tagname, e.g. 'body' or even '*'.

.class Selector

t('.text') selects all Nodes with the className 'text'.

#id Selector

t('#header') returns the Node with the id 'header'.

name Selector

t('[name=password]') scrounges the document for all Nodes with the name 'password'.

DOM Traversing

Traversing shorthands like ~, +, > are also implemented, but less optimized.

Clone this wiki locally