Alex Rivera | Logout

using jquery, how do I check if an element is visible or not?

Asked 2010-02-18T03:00:28.053
10

I also need to find out all the elements inside a div, and check for their visibility. How to do it?

Edit
Report

1 Answer

14

You can select them using the :visible and :hidden pseudo-elements. For example, selects all the visible descendants of a <div>.

$("div :visible")...

Of you can do a test using is(). For example:

if ($("#someId").is(":visible")) { ...
answered 2010-02-18T03:01:33.193

Your Answer