I can count the rows in a table with this line of code.
var count = $('.table tbody tr').length;
I have tried the same thing for a collection, but I seem to get a count of the total number of fields in the collection instead.
So I tried digging through the HTML and finding something besides tbody tr and found both ul and hr appeared to work. For example:
var count = $('.collection hr').length; var count = $('.collection ur').length;
However, as soon as you add fields to the collection, you get strange results for your counts. ur returns a much higher number than expected and hr returns fractions of a number.
Does anyone know what the unique, if any, identifier for a new row is?