循环获取选中的checkbox值

var RewardLevelIds = "";
$("input:checkbox:checked").each(function (i) {
var name = $(this).attr("name");
var id = name.substring(name.indexOf("_") + 1)  //name后面为value值
if (i != 0) {
RewardLevelIds += "," + id;
} else {
RewardLevelIds += id;
}
})

posted @ 2018-04-18 10:13  飞刀软件  阅读(2169)  评论(0编辑  收藏  举报