方式一

 

var selectList='';

jQuery(".table tbody input[type=checkbox]:checked").map(function () {

var id = jQuery.trim(jQuery(this).closest("tr").find("td:eq(0)").text());
 selectList+=id+',';

})

selectList=selectList.substring(0,selectList.length-1);

此方式的第一列是ID列

方式二

 

var selectList = jQuery(".table tbody input[type=checkbox]:checked").map(function () {

return jQuery(this).val();

}).get().join(',');

此方式需要将ID值作为CheckBox的value值

好处是不需要手动将每一个ID值加到字符串中

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-12
  • 2022-12-23
  • 2021-12-23
  • 2022-01-18
  • 2021-04-14
猜你喜欢
  • 2021-08-14
  • 2022-12-23
  • 2022-01-10
  • 2022-12-23
  • 2022-02-08
  • 2021-07-13
  • 2022-12-23
相关资源
相似解决方案