var arr = new Array(); $("input:checkbox[name='contactclient']:checked").each(function(i){ arr[i] = $(this).attr("title"); }); obj.contactclient = arr.join(",");//将数组合并成字符串
layui获取多选框的值,使用逗号分隔
最新推荐文章于 2023-05-06 09:58:08 发布
var arr = new Array(); $("input:checkbox[name='contactclient']:checked").each(function(i){ arr[i] = $(this).attr("title"); }); obj.contactclient = arr.join(",");//将数组合并成字符串