class Selector
Selector(string pattern, [Object context])
When creating a new instance of the Selector, the query are
pre-compiled for later execution with a call to exec.
The constructor can also be called as a function, without the new keyword. Then
the query is executed against the optional context element, otherwise current document.
// Constructor syntax:
new Selector('div > p').exec(document).forEach(function (e) {
e.style.color = 'red';
});
// Or, shorthand syntax:
Selector('div > p', document).forEach(function (e) {
e.style.color = 'red';
});
pattern - selector pattern.[context] - document or context element. Array exec([Object context])
new Selector('div > p').exec(document).forEach(function (e) {
e.style.color = 'red';
});
[context] - document or context element, otherwise current document.Array with matching elements.
When using the Selector within you own framework you can add this function to
extend the resulting Array before it’sthey are returned by exec.
This function is not defined by default, since calling it unneccesarily affects performance.
a - the result array.Array.
When using the Selector within you own framework you can add this function to
extend the resulting Element’s before they are returned by exec.
This function is not defined by default, since calling it unneccesarily affects performance.
e - the result element.Element.
string toSource()
string toString()
For more information, please visit http://www.w3.org/TR/css3-selectors/.