Answers for "jquery get table cell value by row and column"

0

jquery get table cell value by row and column

jquery get table cell value by row and column

$('#mytable tr').each(function() {
    var customerId = $(this).find("td:first").html();    
});

What you are doing is iterating through all the trs in the table,
  finding the first td in the current tr in the loop, and extracting its inner html.

To select a particular cell, you can reference them with an index:

$('#mytable tr').each(function() {
    var customerId = $(this).find("td").eq(2).html();    
});
In the above code, I will be retrieving the value of the third row (the index is zero-based, so the first cell index would be 0)
Posted by: Guest on July-08-2021

Code answers related to "jquery get table cell value by row and column"

Code answers related to "Javascript"

Browse Popular Code Answers by Language