开发者

pass value as array/collection

开发者 https://www.devze.com 2023-01-10 15:36 出处:网络
I have this code: var addNew = $(\'#divListBox\').find(\':checked\') .map(function() { return $(this).val();

I have this code:

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

I want to know if there's a way to get all the value that's checked and put t开发者_高级运维hem in a collection so I can send it to my controller?


you can do this...

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

精彩评论

暂无评论...
验证码 换一张
取 消