Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find out if an elements containing DIV is hidden 1

Status
Not open for further replies.

ashorton

Programmer
Mar 1, 2001
24
GB
I have a collapsable tree view where each section can be either hidden or visible. I do this using several DIV tags. Within each DIV there is a series of input elements. When I access an element within a section using Javascript I need to know if the section (DIV) that contains the element is hidden.

Any Idea's
 
(xxx.divname.style.yyy=="hidden") is true if the div is hidden, false otherwise
yyy is "visible" or "visibility" depending on the browser you're targetting
xxx depends on which browser you're targetting
also some ns version won't recognise "hidden" but "hide"
also, you can use display instead of visibility
actually, all this depends on what you used to hide/show the divs
use the same syntax (display or visible or visibility) you used to hide/show
 
how do you determine (in Netscape) which is <div> is the container, I have a similar issue... for example ...

<div>
<div>
<input>
</div>
</div>

I can it be determined which div is the parent of the input?? and then possibly which div is the parent of the input's parent div??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top