I'm trying to use jQuery's add function... but when merging objects of 3000+ dom elements, it freezes up. Is there any faster way I can achieve this?
var a = [];
a[0] = $('small');
a[1] = $('.no');
a[2] = $('.yes');
//a is array of jQuery objects
//make b an empty jQuery object. loop through a, adding each to b
var b = $();
for(var i in a) {
b = b.add(a[i]);
}
//browser freezes for a bit
console.log(b);
Edit: Don't question why I have so many DOM elements, I'm stress testing a jQuery plugin I'm writing :D