[本文出自天外归云的博客园]ajax
问题:把选中行的ID统计出来,组成一个数组传给后台(选中行的特色:class为danger)数组
办法以下:this
// 多选后点击下线按钮 $("#offline").click(function () { var idList = []; $("tr.danger").each(function () { idList.push($(this).children("td:eq(1)").text()); }); // console.log(idList); $.ajax({ type: 'POST', url: "请求路径", data: { "idList": idList, ... }, success: function () { window.location.reload(); } }); });