Provides support for using CSS selectors to query the DOM
ancestor
node
selector
testSelf
A convenience method to emulate Y.Node's aNode.ancestor(selector).
node
HTMLElement
A node to start the query from.
selector
String
A CSS selector to test the node against.
testSelf
Boolean
optional Whether or not to include the node in the scan.
The ancestor node matching the selector, or null.
filter
nodes
selector
Filters out nodes that do not match the given CSS selector.
nodes
HTMLElement[]
An array of nodes.
selector
String
A CSS selector to test each node against.
The nodes that matched the given CSS selector.
query
selector
root
firstOnly
Retrieves a set of nodes based on a given CSS selector.
selector
String
A CSS selector.
root
HTMLElement
optional A node to start the query from. Defaults to Y.config.doc
.
firstOnly
Boolean
optional Whether or not to return only the first match.
The array of nodes that matched the given selector.
test
node
selector
root
Determines whether or not the given node matches the given CSS selector.
node
HTMLElement
A node to test.
selector
String
A CSS selector to test the node against.
root
HTMLElement
optional A node to start the query from. Defaults to the parent document of the node.
Whether or not the given node matched the given CSS selector.
operators
List of operators and corresponding boolean functions. These functions are passed the attribute and the current node's value of the attribute.
useNative
Use the native version of querySelectorAll
, if it exists.
Default: true