tags:

views:

29

answers:

2

Using jQuery I can do something like this:

var x = $('#hello');
x = x.add('#bye');

This way I have both #hello and #bye elements in the query set called x. Is there a similar function in Dojo?

+6  A: 

I think you're looking for adopt - http://api.dojotoolkit.org/jsdoc/1.3.2/dojo.NodeList.adopt

var x = dojo.query('#hello');
x = x.adopt('#bye');
BBonifield
Thank you. Looks like that's exactly what I want.
ipartola
+1  A: 

I don't think there is directly, but the following should work:

var x = dojo.query('#hello');
x = x.concat(dojo.query('#bye'));

Then x[0] would be #hello. x[1] would be #bye.

JasonStoltz
Nevermind. it looks like BBonifield has found a better answer :)
JasonStoltz