【发布时间】:2020-07-05 13:27:07
【问题描述】:
我正在搜索项目。在其中搜索值的块由几个元素组成。我需要从搜索中排除最后一项。那些。这样这个元素就不会受到影响,除了其余的。
我试过这样
$('.blog_content_item').not('.last').each(function() {...});
和
$(".blog_content_item:not('.last')").each(function() {...});
没有帮助。这在语法上都是不正确的。请告诉我如何从搜索中排除“最后一个”元素。谢谢。
$('.blog_content_item').each(function() {
if($(this).text().toLowerCase().indexOf(value) === -1) {
...
return;
} else {
...
}
});
<div class="blog_content_item">
<div class="first">
<div class="middle">
<div class="last">
</div>
【问题讨论】: