How do I count the number of tr elements within a table using jQuery?
I know there is a similar question, but I just want the total rows.
Use a selector that will select all the rows and take the length.
var rowCount = $('#myTable tr').length;
Note: this approach also counts all trs of every nested table!
2.1m questions
2.1m answers
60 comments
57.0k users