[thelist] Q on dHTML sibling/child
Hassan Schroeder
hassan at webtuitive.com
Sat Mar 13 14:31:29 CST 2004
jsWalter wrote:
> <span onclick="do_menu(this)" id='zz'>
> <a href="#" Xtarget="display">About</a>
> </span>
> For some reason, I can't seem to remember how to retrieve an object
> reference to a sibling of a given HTML element.
>
> Can someone show me the bloody obvious?
var s = document.getElementById("zz").nextSibling :-)
However, it's likely to be a text (white space) node, so you need
to check and if necessary loop until you find the node you want...
HTH,
--
Hassan Schroeder ----------------------------- hassan at webtuitive.com
Webtuitive Design === (+1) 408-938-0567 === http://webtuitive.com
dream. code.
More information about the thelist
mailing list