如何从项目列表中过滤当前项目。例如。
$('.div').click(
function (){
$(this).val('this is clicked');
//! get the items that are not clicked
}
)
$('.div')
返回项目列表,并单击其中一个。如何获取未点击的项目列表。
注意:我不是在寻找将属性添加到单击的项目(或未舔的项目)并对其进行过滤的解决方案。
如何从项目列表中过滤当前项目。例如。
$('.div').click(
function (){
$(this).val('this is clicked');
//! get the items that are not clicked
}
)
$('.div')
返回项目列表,并单击其中一个。如何获取未点击的项目列表。
注意:我不是在寻找将属性添加到单击的项目(或未舔的项目)并对其进行过滤的解决方案。
$('.div').click(
function (){
$(this).val('this is clicked');
var others = $(".div").not($(this));
}
)
试试兄弟选择器:
$(this).siblings()
怎么样$('.div:not(this)')
?