hi guys,
i'm developing a function that having as argument the branch of a
structured tree returns the tree showing only the parents of that
branch..
the function that doesn't work is the following:
function openParents(id) {
if (document.getEl ementById(id).c lassName!="root ") {
var par=document.ge tElementById(id ).parentNode;
par.nextSibling .style.display= "block";
openParents(par .id)
}
}
this function should recall itself in order to open all the ancestors..
i really cannot understand why it doesn't work!
(the argument given is the id of a branch)
thank u to everyone!
teo
i'm developing a function that having as argument the branch of a
structured tree returns the tree showing only the parents of that
branch..
the function that doesn't work is the following:
function openParents(id) {
if (document.getEl ementById(id).c lassName!="root ") {
var par=document.ge tElementById(id ).parentNode;
par.nextSibling .style.display= "block";
openParents(par .id)
}
}
this function should recall itself in order to open all the ancestors..
i really cannot understand why it doesn't work!
(the argument given is the id of a branch)
thank u to everyone!
teo
Comment