$('.dosubmit').click(function(){
var checkID = [];//定义一个空数组
$("input[name='check']:checked").each(function(i){//把所有被选中的复选框的值存入数组
checkID[i] =$(this).val();
});
console.log(checkID)
//用Ajax传递参数
$.ajax({
async: false,
type: "POST",
contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
scriptCharset: 'utf-8',
//data: ,
url: "",
success: function (_res) {
},
error: function(_error){
}
});
})
jq 获取所有选中checkbox并提交
最新推荐文章于 2024-05-16 16:53:58 发布