for(i=0;i<posts.length;i++){ for(key in result[1]){ if (key==posts[i].getAttribute('pid')){ result[0].splice(key,1) } } }