Is there any way to call jQuery each() asynchronously?
asynchronous, each, javascript, jquery
Solution
No, each method can't be asynchronous because it was made to be synchronous, to work like a for loop : it proceeds begining by the first element, then the second... until the last.
Problem
Ok, i have this little script. ``` var parent_li = $('ul.list').find('li'); parent_li.each(function(){ var dmy_checkb = $(this).find('.dmy_checkb'), true_inpt = $(this).find('input'); dmy_checkb.trigger('click'); true_inpt.attr('checked','checked'); }); ``` This is some kind of dummy checkbox function - it adds a certain class and attribute. Everything works fine. The problem is only in the number of requests, class and attribute are added only when the function is executed services to all elements, so if i have them 300 takes quite a long time, is there a chance for an asynchronous call this method separately for each of the elements? Thx for help.