Selector Class
Provides support for using CSS selectors to query the DOM
Methods
ancestor
(
HTMLElement
static
-
element
-
selector
-
testSelf
A convenience function to emulate Y.Node's aNode.ancestor(selector).
Parameters:
-
element
HTMLElementAn HTMLElement to start the query from.
-
selector
StringThe CSS selector to test the node against.
-
testSelf
Booleanoptional Whether or not to include the element in the scan
Returns:
HTMLElement:
The ancestor node matching the selector, or null.
query
(
Array
static
-
selector
-
root
-
firstOnly
Retrieves a set of nodes based on a given CSS selector.
Parameters:
-
selector
StringThe CSS Selector to test the node against.
-
root
HTMLElementoptional An HTMLElement to start the query from. Defaults to Y.config.doc
-
firstOnly
Booleanoptional Whether or not to return only the first match.
Returns:
Array:
An array of nodes that match the given selector.