<script type="text/javascript"> //type 是用于判断类型的,与主题无关 function doAll(type) { var ids = ‘‘; //获取所有选中的值,将其用逗号隔开 $(‘input[type="checkbox"]:checked‘).each(function(index,value) { if($(value).val() != ‘on‘) { ids += $(this).val() + ‘,‘; } }); if (ids == ‘‘) { alert(‘没有选择任何数据!‘) return false; }; $.get("__URL__/doAll",{‘ids‘ : ids,‘type‘ : type},function(data) { if(data == ‘1‘) { alert(‘批量处理成功!‘); }else { alert(‘批量处理失败!‘); } window.location.href="__URL__/audit"; },‘html‘); } $(‘#showall‘).click(function() { window.location.href="__URL__/audit"; }); </script>
jquery 获取页面所有选中checkbox的值,布布扣,bubuko.com
原文:http://www.cnblogs.com/lxdd/p/3921649.html