Hi Jonathan,

Try this:

var x = $('span');
var y = $('div');
var z = x.add(y);

z.each(function(){alert('yo');})

--Karl

____________
Karl Swedberg
www.englishrules.com
www.learningjquery.com




On Aug 25, 2008, at 11:19 AM, Jonathan C. Dietrich wrote:


What is the easiest way to combine the results from multiple jquery
objects.

for instance if i want to do an operation with each span and div tag

x = $('span');
y = $('div');

x.each(function(){alert('yo');})
y.each(function(){alert('yo');})

is there a way that i can combine x and y in z so that i can just call
the following once instead of multiple times?

z.each(function(){alert('yo');})






Reply via email to