Reputation: 168
I want to wrap all the items below "name portlet-title" But, Should not include other items in "div class name portlet-title" below. where i tried following ways:
1) $("div.item").wrapAll('<div class="portlet-body"></div>');
it is effecting all item in page.
2) $("div.list").wrapInner('<div class="portlet-body"></div>');
it is including "div class name portlet-title"
i am not so good at jquery please help me out.
Upvotes: 0
Views: 357
Reputation: 388406
You need to use a loop so that you can group the items separately.
$('.list.portlet').each(function(){
$(this).find('div.item').wrapAll('<div class="portlet-body"></div>')
})
Upvotes: 1