I have some element I want to remove but I want to keep the one that have a certain attribute
Here is my code
$(".glarry-" + activegallery + " " + ".product-gallery .thumbnails .thumbnail").not('[data-source="'+ $(this).data('source') +'"]').remove();
I also tried this
$(".glarry-" + activegallery + " " + ".product-gallery .thumbnails .thumbnail:not([data-source='" + $(this).data('source') + "'])").remove();
This remove all the element, irrespective of the not