Alex Rivera | Logout

jQuery: How to count the number of elements which "display" isn't "none"?

Asked 2011-03-16T12:09:12.240
12

I use show() and hide() to show and hide rows in a table.

How could I count the number of non-hidden rows (more accurately, rows with display != none) ?

Note that:

$('tr:visible').length

won't work because if the table itself has display=none, the result will always be 0.

Edit
Report

1 Answer

2
answered 2011-03-16T12:16:12.363

Your Answer