获取checkbox数组 里面的值

时间:2022-05-16 06:37:16

echo '<td class="text-left"><input  name="tids[]" type="checkbox" id="checkbox_'.$list['tid'].'" value="'.$list['tid'].'"</td>';

var tids = '';
                var tmp = [];
                $("input[name='tids[]']:checked").each(function(i,n){
                    tmp.push(n.value);
                });
                if(tmp){ postData.tids = tmp.join(',')};