jq 获取页面中checkbox已经选中的checkbox

mac2022-06-30  92

var array={}; var arrChk=$("input[name='bike']:checked"); if(arrChk.length<=0){ alert('请先勾选数据,在进行批量清档!'); } var i=0; $(arrChk).each(function(){ array["bike[" + i + "]"] =this.value;//组装数组 i++; }); var url="./index.php?module=operation&action=data_clear_all"; $.ajax({ type:'POST', url:url, data:array, dataType:"json", success:function(data){ if(data){ alert('批量清档成功'); }else{ alert('批量清档失败'); } }后台php接受$arr=$_POST['bike']; //即可

 

转载于:https://www.cnblogs.com/hgj123/p/4521981.html

相关资源:jQuery获取checkbox选中的值
最新回复(0)