Remove duplicate content with Jquery

var seen = {}; $('ul#postname h2').each(function() { var txt = $(this).text(); if (seen[txt]) $(this).remove(); else seen[txt] = true; });

1 Response

How can i copy this code

Write a comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.