Я просматриваю свой HTML-файл с помощью jQuery, чтобы собирать элементы. Затем я хочу выполнить операцию jQuery для каждого найденного элемента. Это то, что у меня есть до сих пор, но оно не работает, поскольку я не знаю, как хранить элементы jQuery из каждого метода. Может кто-нибудь помочь?Сбор элементов jQuery в коллекции
var foundElems = [];
$('#some-container .some-class').each(function(index) {
//filter $(this)
//store $(this)
foundElems.push($(this));
});
$('#some-container2 .some-class2').each(function(index) {
//filter $(this)
//store $(this)
foundElems.push($(this));
});
//do this again for many containers....
//then call some jQuery function on each element of that collection
foundElems.fadeOut('slow');