场景
在Jquery中遍历多选框,获取属性为checked即被选中的input的value。
实现
function printDetails(){debuggervar checkID = [];//定义一个空数组$("input[name='checkedid']:checked").each(function(i){//把所有被选中的复选框的值存入数组checkID[i] =$(this).val();console.log(checkID);});$.ajax({type: 'POST',url: "/wmsReceiveOrder/doPrintDetailsPostRequest",cache: false, //禁用缓存data:JSON.stringify({"id":checkID}),contentType: "application/json",dataType: "json",async:true,success: function (result) {debuggeralert(result.message)}})}