$('.list_body').each(function(){
var job_no = $(this).data('job_id');
if($.inArray(job_no, return_data)) {
$.noop();
}
else {
$(this).closest('div.list_body').remove();
}
});
.list_body
data-attribute holds a job id reference.
What I need to do is remove the particular .list_body
div if the job id is not included in the array return_data
.
Not sure if the .each()
function is the best practice here as currently it seems to get rid of a div even though the job id is in the array.