Reputation: 2923
I have this JS code :
var trs = $("#internalActivities > tbody > tr");
I want to be able to use the variable trs
to find the number of visible rows in the table.
This is the code that I am looking to convert to use the variable
$("#internalActivities > tbody > tr:visible").length
I am looking for a code like this: trs:visible.length
. Of course this code won't work but I want the syntax that works.
Thanks
Upvotes: 0
Views: 42
Reputation: 11381
Won't this work ?
trs.filter(":visible").length
From the docs:
Reduce the set of matched elements to those that match the selector or pass the function's test.
More info here at filter
documentation.
Upvotes: 2