hey peeps!!! hope everything is fine!! im trying to use a jquery clone a collection with specific parameters… i have a div with my original collection(i have a nested collection inside) showing all the itens. Now i’m trying to clone the collection twice! ie: at the first clone i would like to clone only the itens that have a label “Orlando” and at the second clone list i want to clone only the itens that have a label “Miami”… i did some personalization on custom code with the clone project and doesnt work… i tried a lot of alternatives but no success…
my code:
$(‘.bairros-item .bairros-regiao-label’).each((i,item)=>{ const label = $(‘.bairros-regiao-label’).text(); if( label == ‘Orlando’){
$(item).closest(‘.bairros-item’)
.clone()
.appendTo(‘.bairros-collection-list.orlando’)
}
else{
$(item).closest(‘.bairros-item’)
.clone()
.appendTo(‘.bairros-collection-list.miami’)
}});
Here is my public share link: https://selecta-hotsites.webflow.io/cidades-e-bairros