views:

40

answers:

3

Hello. I'd like to know if there's a test conditions using which one can check the visibility state(hidden or visible) of a tag.

I mean a test condition,which could be used with the if() statement.

thanks!

A: 

Simple solution is to use jQuery and do $('#id').is(':visible'). Otherwise you'll be writing a function that doesn't work as well and isn't as nicely coded.

meder
+1  A: 

if you are using jQuery then:

$('#id').is(':visible');
jarrett
A: 

If you use jQuery, it's very easy:

if ($(SELECTOR).is(":visible")) {
  // do amazing things
}
Júlio Santos