Posted By

Onfire60 on 03/31/11


Tagged

javascript jquery


Versions (?)

Remove Duplicate Items From Multiple Ordered Lists Individually


 / Published in: jQuery
 

  1. <script type="text/javascript" charset="utf-8">
  2. $(document).ready(function() {
  3. $('ol').each(function() {
  4. var seen = {};
  5. $(this).children('li').each(function() {
  6. var txt = $(this).text();
  7. if (seen[txt])
  8. $(this).remove();
  9. else
  10. seen[txt] = true;
  11. });
  12. });
  13. });
  14. </script>

Report this snippet  

You need to login to post a comment.