How to get a table cell value using jQuery?

后端 未结 9 1188
终归单人心
终归单人心 2020-11-22 14:41

I am trying to work out how to get the value of table cell for each row using jQuery.

My table looks like this:

9条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-22 15:41

    $('#mytable tr').each(function() {
      // need this to skip the first row
      if ($(this).find("td:first").length > 0) {
        var cutomerId = $(this).find("td:first").html();
      }
    });
    

提交回复
热议问题