I have this Jquery code that construct a collection of jquery objects. It takes around 600 ms to execute. I want to optimize it:
var tousBt = $('img.boutonReduire');
var stack = $('');
tousBt.each( function() {
var id = $(this).attr('id');
stack = stack.add('#table' + id).add('#img' + id);
});
Do you see something that I can do ? The result has to be a collection of jquery objects.
Edit: I get all the stacks elements and hide them : stack.addClass('hideit'); There is around 125 elements. And $('*').length give around 7100 elements.