Custom class to allow all of its methods to be used with any Selectors element via the dollar function $.
Gets all the elements within an element that match the given selector.
var myElements = myElement.getElements(selector[, nocash]);
//Returns all anchors within myElement. $('myElement').getElements('a'); //Returns all input tags with name "dialog". $('myElement').getElements('input[name=dialog]'); //Returns all input tags with names ending with 'log'. $('myElement').getElements('input[name$=log]'); //Returns all email links (starting with "mailto:"). $('myElement').getElements('a[href^=mailto:]'); //Adds events to all Elements with the class name 'email'. $(document.body).getElements('a.email').addEvents({ 'mouseenter': function(){ this.href = 'real@email.com'; }, 'mouseleave': function(){ this.href = '#'; } });
Supports these operators in attribute selectors:
Xpath is used automatically in compliant browsers.
Same as Element:getElements, but returns only the first.
var anElement = myElement.getElement(selector);
var found = $('myElement').getElement('.findMe').setStyle('color', '#f00');
Alias for Element:getElement, using document as context.
Matches the Element with the given selector.
var matched = myElement.match(selector);
//Returns true if the Element is a div named "somename". $('myElement').match('div[name=somename]');
This documentation is released under a Attribution-NonCommercial-ShareAlike 3.0 License.