gpt4 book ai didi

jquery - 过滤除此之外的内容

转载 作者:行者123 更新时间:2023-12-03 22:31:49 25 4
gpt4 key购买 nike

如何从项目列表中过滤当前项目。例如。

$('.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));

}
)

关于jquery - 过滤除此之外的内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5209570/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com