gpt4 book ai didi

javascript - 将值作为数组/集合传递

转载 作者:行者123 更新时间:2023-11-28 02:52:46 25 4
gpt4 key购买 nike

我有这个代码:

var addNew = $('#divListBox').find(':checked')
.map(function() {
return $(this).val();
}).get();

我想知道是否有办法获取所有已检查的值并将它们放入集合中,以便我可以将其发送到我的 Controller ?

最佳答案

你可以做到这一点...

var v_coll=[];
$('#divListBox').find(':checked').each(function(){
v_coll.push($(this).val);
});

关于javascript - 将值作为数组/集合传递,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3439956/

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