我想通过.id p
动态删除$.each
中的一个相同短语,我尝试使用以下代码但这对我不起作用,它删除了{{1}中的所有短语}}:
怎么回事?
DEMO:http://jsbin.com/juyiwololi/
.id p

$('.id p').each(function() {
var item = $(this).text();
alert(item);
$('.id p').filter(function() {
return $(this).text() == item
}).remove();
});