the compact javascript framework
in partnership with mediatemple
Css Query related functions and Element extensions
MIT-style license.
Element. Selectors.js | Css Query related functions and Element extensions |
Utility Functions | |
Functions | |
$E | Selects a single (i.e. |
$ES | Returns a collection of Elements that match the selector passed in limited to the scope of the optional filter. |
Element | Custom class to allow all of its methods to be used with any DOM element via the dollar function $. |
Properties | |
getElements | Gets all the elements within an element that match the given (single) selector. |
getElement | Same as Element.getElements, but returns only the first. |
getElementsBySelector | Same as Element.getElements, but allows for comma separated selectors, as in css. |
getElementById | Targets an element with the specified id found inside the Element. |
Selects a single (i.e. the first found) Element based on the selector passed in and an optional filter element. Returns as Element.
selector | string; the css selector to match |
filter | optional; a DOM element to limit the scope of the selector match; defaults to document. |
$E('a', 'myElement') //find the first anchor tag inside the DOM element with id 'myElement'
a DOM element | the first element that matches the selector |
Returns a collection of Elements that match the selector passed in limited to the scope of the optional filter. See Also: Element.getElements for an alternate syntax. Returns as Elements.
an array of dom elements that match the selector within the filter
selector | string; css selector to match |
filter | optional; a DOM element to limit the scope of the selector match; defaults to document. |
$ES("a") //gets all the anchor tags; synonymous with $$("a") $ES('a','myElement') //get all the anchor tags within $('myElement')
Custom class to allow all of its methods to be used with any DOM element via the dollar function $.
Properties | |
getElements | Gets all the elements within an element that match the given (single) selector. |
getElement | Same as Element.getElements, but returns only the first. |
getElementsBySelector | Same as Element.getElements, but allows for comma separated selectors, as in css. |
getElementById | Targets an element with the specified id found inside the Element. |
Gets all the elements within an element that match the given (single) selector. Returns as Elements.
selector | string; the css selector to match |
$('myElement').getElements('a'); // get all anchors within myElement $('myElement').getElements('input[id=dialog]') //get all input tags with name 'dialog' $('myElement').getElements('input[name$=log]') //get all input tags with names ending with 'log'
Supports these operators in attribute selectors:
Xpath is used automatically for compliant browsers.
Same as Element.getElements, but returns only the first. Alternate syntax for $E, where filter is the Element. Returns as Element.
selector | string; css selector |
Same as Element.getElements, but allows for comma separated selectors, as in css. Alternate syntax for $$, where filter is the Element. Returns as Elements.
selector | string; css selector |
Selects a single (i.e.
Returns a collection of Elements that match the selector passed in limited to the scope of the optional filter.
returns the element passed in with all the Element prototypes applied.
Selects, and extends DOM elements.
document.getElementsBySelector = document.getElementsByTagName; function $$()
Documentation by Aaron Newton & Mootools Developers, generated by NaturalDocs and GeSHi