Query

Query, Query.descendant

The Query plugin provides functionality used to query the document with CSS selectors. The Standard Query plugin is adapted from Dean Edwards cssQuery. If you use libraries like Prototype or jQuery, JavaScriptMVC will use subsitute those libraries' querying functionality for the Standard library.

Allowed Selectors

Examples

$('span');
// -> all SPANs in the document.  Same as document.getElementsByTagName('SPAN').

Query('#todo');
// -> same as $E('todo'), only it returns an array.

Query('p.foo');
// -> all P elements with class 'foo'

Methods

Query

Query(cssRule) -> [HTMLElement...]

Takes an CSS selectors (string) and returns a document-order array of extended DOM elements that match.

Query.descendant

Query(element, cssRule) -> [HTMLElement...]

Takes a element and a CSS selectors (strings) and returns an array of extended children of the element that match the css selector.