admin 发表于 2022-5-7 22:31:20

【JQuery】获取checkbox选中的值

var mtype = [];
$("#relation :checked").each(function () {
        mtype.push($(this).val());
});
$.ajax({
        url: "./?sitemenu",
        type: 'post',
        dataType: 'json',
        data: { ajax: 1, step: 1, mtype: mtype },
        success: function (data) {
                //console.log(data);
        }
});
页: [1]
查看完整版本: 【JQuery】获取checkbox选中的值