ASDFdotASPX
ASDFdotASPX

Reputation:

does YUI have selectors like in jQuery?

Does YUI have selector methods like jQuery?

e.g. get me all div's that are children of <table> that have links in them?

Upvotes: 5

Views: 2854

Answers (3)

Morgan Cheng
Morgan Cheng

Reputation: 76008

YUI has selector utility since version 2 (http://developer.yahoo.com/yui/selector/), but it doesn't get popular in YUI 2 since most of module codes are written before selector is introduced into YUI2.

Upvotes: 1

Anirvan
Anirvan

Reputation: 6354

YUI 3 (currently in preview release) has explicitly JQuery-like selectors:

Y.all('.foo').set('title', 'Go!').removeClass('off');

Take a look at:

I've gotten good results using YUI 3 Preview Release 1 on OffsetConsumer.org, a website I'm working on; the next YUI 3 preview release is scheduled to come out in November.

Upvotes: 7

Christian C. Salvad&#243;
Christian C. Salvad&#243;

Reputation: 827306

Check the YUI Selector Utility, it gives you CSS3 selector sintax, it still in beta but works quite well, check this example: YAHOO.util.Selector.query

Upvotes: 5

Related Questions