views:

31

answers:

1

I have a table with multiple <tbody> elements. At a given momement, certain <tbody> elements are visible and some are hidden, and I need to select only the visible ones.
I use jQuery's :visible selector.

Now the problem is that I need to perform that task before I display the table, AKA while the table is hidden, and then the :visible selector doesn't work.

How can I select "visible" <tbody> elements while the table is hidden?

Thanks.

A: 

You can call .filter:

$('tbody').filter(function() { return $(this).css('display') !== 'none'; })
SLaks
is it display:none or visbility:hidden ?
Lizard
I suppose that'd work. Thank you.
xyz