li").each(function(n,item){ jQuery(item).remove(); }-6ren">
gpt4 book ai didi

jquery-mobile - 无法从列表中删除所有 "li"项目

转载 作者:行者123 更新时间:2023-12-04 06:32:21 26 4
gpt4 key购买 nike

为什么这个片段不删除所有数据列表<li>项目?

jQuery("#list2 > li").each(function(n,item){         
jQuery(item).remove();
});

最佳答案

你不需要循环,只需要:

jQuery("#list2 > li").remove();

删除所有。

关于jquery-mobile - 无法从列表中删除所有 "li"项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9581364/

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