Hi,
I have a structure like this in my xhtml 1.0 file.
<body>
<div>
<a>
<img ... id="f1" />
<span>....</span><br/>
<span>....</span>
</a>
---> <div>
<img />
<span>....</span><br/>
<span>....</span>
</div>
---> <div>
<img />
<span>....</span><br/>
<span>....</span>
</div>
</div>
</body>
I want to acces the div blocks with the arrows from a java script. I use
the javas script object reference elment node. When somebody clicks on
the image with id f1, i want to make invisible the div elements with arrows.
I try to write this:
function make_visible(id _img){
document.getEle mentById(id_img ).parentNode.pa rentNode.childN odes[2].style.display= "none";
document.getEle mentById(id_img ).parentNode.pa rentNode.childN odes[3].style.display= "none";
}
but it does not work.
If i write :
document.getEle mentById(id_img ).parentNode.pa rentNode.childN odes[1].style.display= "none";
after clicking the <a> block gets invisible. The next child will be the
div element. Isn't it?
I do not understand why it does not work, can anybody help me?
I have a structure like this in my xhtml 1.0 file.
<body>
<div>
<a>
<img ... id="f1" />
<span>....</span><br/>
<span>....</span>
</a>
---> <div>
<img />
<span>....</span><br/>
<span>....</span>
</div>
---> <div>
<img />
<span>....</span><br/>
<span>....</span>
</div>
</div>
</body>
I want to acces the div blocks with the arrows from a java script. I use
the javas script object reference elment node. When somebody clicks on
the image with id f1, i want to make invisible the div elements with arrows.
I try to write this:
function make_visible(id _img){
document.getEle mentById(id_img ).parentNode.pa rentNode.childN odes[2].style.display= "none";
document.getEle mentById(id_img ).parentNode.pa rentNode.childN odes[3].style.display= "none";
}
but it does not work.
If i write :
document.getEle mentById(id_img ).parentNode.pa rentNode.childN odes[1].style.display= "none";
after clicking the <a> block gets invisible. The next child will be the
div element. Isn't it?
I do not understand why it does not work, can anybody help me?
Comment