jquery get each row in table 1

jquery get each row in table

$('table > tbody  > tr').each(function(index, tr) { 
   console.log(index);
   console.log(tr);
});

Here is what the above code is Doing:
1. We’re selecting the table element.
2. We’re selecting the tbody element.
3. We’re selecting all the tr elements.
4. We’re iterating over each tr element.
5. We’re logging the index of the tr element.
6. We’re logging the tr element itself.

Similar Posts