Reputation: 3711
i go threw some elements with same class with each
function. but if i wrap
them each element gets wrapped.
so HTML should look like
<div class="wrap">
<div class="each"></div>
<div class="each"></div>
</div>
and not like
<div class="wrap"><div class="each"></div></div>
<div class="wrap"><div class="each"></div></div>
Upvotes: 0
Views: 330
Reputation: 146302
var collect_all_each = $('<div>',{'class': 'wrap'});
$('.each').each(function(){
$(this).appendTo(collect_all_each);
});
Upvotes: 0