循环遍历idObj对象,获取其中每个值
var id = ''; $.each($('input:checkbox:checked'),function(){ // window.alert("你选了:"+ // $('input[type=checkbox]:checked').length+"个,其中有:"+$(this).val()); id += $(this).val()+','; }); // 去掉最后的,通过截取字符串获取 id = id.substring(0,id.length-1); console.log(id)