gpt4 book ai didi

javascript - bootstrap tagsinput 使用 jquery 删除项目

转载 作者:行者123 更新时间:2023-11-30 21:16:26 26 4
gpt4 key购买 nike

我正在使用 Bootstrap 标签输入字段。因为我在下面使用 jquery 添加代码成功运行的项目。

$('#tag').tagsinput('add', { "value": 1 , "text": "Amsterdam"   , "continent": "Europe"    });

现在我需要使用 jquery 删除添加的项目。我试过下面的代码

 $('#tag').tagsinput('remove', { "value": 1 , "text": "Amsterdam"   , "continent": "Europe"    });

但它似乎不起作用。我如何使用 jquery 删除项目。

最佳答案

我认为你犯了这个错误:

 $('#tag').tagsinput('remove', { "value": 1 , "text": "Amsterdam"   , 
"continent": "Europe" });

但我认为它应该是:

 $('#tag').tagsinput('remove', { value: 1 , text: 'Amsterdam'   , 
continent: 'Europe' });

试试看,希望有用。

关于javascript - bootstrap tagsinput 使用 jquery 删除项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45646550/

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