说我有以下
<h3>This is my heading</h3>
<p>This is my headingAnd this is part of a paragraph</p>
我想结束以下
<h3>This is my heading</h3>
<p>And this is part of a paragraph...</p>
我找到了这段代码
$(function() {
var seen = {};
$('p, h3').each(function() {
var txt = $(this).text();
if (seen[txt])
$(this).remove();
else
seen[txt] = true;
});
});
但是因为段落中加入了两个单词,所以它不起作用。数据是从 rss 提要中动态提取的。
提前致谢