I’m trying to remove a specific ID that exists in a list of IDs, here’s the code of the ID and the list
var idClient = $('.popup-chat-header').attr("id"); // a client ID
// loop through a list of ID
$('#clientList li > a').each(function(){
var newIdList = $(this).attr("id");
});
I have tried :contains() Selector, (newIdList:contains(idClient)).remove(), but it seems im not implementing it the right way? any tips is appreciated!
Have you tried something like this instead of the $.each loop: