Skip to content Skip to sidebar Skip to footer

YUI.getElementsBy Equivalent To JQuery

Is there any JQuery method/implementation that equivalent to YUI.getElementsBy? YUI.getElementsBy ( method , tag , root , apply , o , overrides ) thanks, Simon

Solution 1:

The description of that method is as follows:

Array getElementsBy ( method , tag , root , apply , o , overrides )

Returns an array of HTMLElements that pass the test applied by supplied boolean method

You can replicate that functionality in jQuery with the filter method, and if you want to return an array of HTMLElement objects, you can use get (otherwise you will have a jQuery object):

$(selector).filter(method).get();

In the jQuery version, both tag and root arguments would be combined into the selector.


Post a Comment for "YUI.getElementsBy Equivalent To JQuery"