can I do that?

J

Joseph

What I am trying to do is access the child element (ie.: idDivConfigChild)
of a DIV (ie: idDivConfig ) itself contained in a Parent DIV( idOutput )
The idea is to hide all the other Child Divs and only display the selected
Child DIV

The HTML page all this is supposed to work from (everything else is ok) can
be found here:
http://www.geocities.com/philippeoget
<DIV id='idOutput'>
<DIV id="idDivConfig" onclick="Hide_Divs('idOutput','idDivConfig)">
<span id="IMGidDivConfig" style="display:inline;"
class="PlusMinus">+ </span>
<span style="display:inline;" id=1> IP Config Results:
</span>
<div class="Child" id="idDivConfigChild">blah </DIV> </DIV>
<DIV id="idDivPing" onclick="Hide_Divs('idOutput','idDivPingChild')">
<span id="IMGidDivPing" style="display:inline;"
class="PlusMinus">+ </span>
<span style="display:inline;" id=2> Ping Results: </span>
<div class="Child" id="idDivPingChild">blah </DIV> </DIV>
</DIV>

function Hide_Divs(theDiv,TheDivToShow) {
var elDiv = getElementWithId(theDiv);
for (var x = 0; elDiv.childNodes[x]; x++) {
if (elDiv.childNodes[x].id.length>0) {
alert(elDiv.childNodes[x].id);
var babe = getElementWithId(elDiv.childNodes[x].id);
var babeID = getElementWithId(babe.id);
/* problem is here:*/
babe = babe+'Child'; // babe is undefined
alert('1-babe = '+babe);

if (babe==TheDivToShow) {
var sDivToShow = elDiv.childNodes[x].id;
alert('sDivToShow = '+babe);
}
alert('2 babe = '+babe); // babe is undefined

document.all(babe).style.display = "none";
}
}
document.all(sDivToShow).style.display = "";
}

Thanks to all for your time

Joseph

philippeoget at hotmail dot com
http://www.geocities.com/philippeoget/a2z/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,586
Members
45,084
Latest member
HansGeorgi

Latest Threads

Top