Your Ad Here

Posted By

crypticsoft on 02/26/11


Tagged


Versions (?)

Remove duplicate elements


 / Published in: jQuery
 

URL: http://stackoverflow.com/questions/2822962/jquery-remove-duplicate-elements

  1. var seen = {};
  2. $('div.related div a').each(function() {
  3. var txt = $(this).text();
  4. if (seen[txt])
  5. $(this).remove();
  6. else
  7. seen[txt] = true;
  8. });

Report this snippet  

You need to login to post a comment.