Element.visible returns false if display is set to none, true otherwise.
Note: an element with visibility set to hidden will return true !
V1.5_rc5 (prototype V 1.4.0_rc3)
Element.visible( element );
element can be any DOM Element object or an ID.
<p id="desc" style="display:none">
An adept sycophant hides in his hole.
</p>
<p>
<a href="#" onclick="alert(Element.visible('desc')); return false;">
is this element visible?
</a>
</p>
creates:
is this element visible?
<p id="mypara" style="visibility:hidden">
An adept sycophant hides in his hole.
</p>
<p>
<a href="#" onclick="alert(Element.visible('mypara')); return false;">
is this element visible?
</a>
</p>
creates:
An adept sycophant hides in his hole.
is this element visible?