Lwis schrieb:
Hi,
short version: how do I find out whether my element is a child of
another element?
long version: I think I want to loop through all elements and check
each of them if it is the element I am searching for or not.
I think I want something similar to YUI (http://www.un-instraw.org/
wiki/training/skins/ycal/yui/docs/treeview/overview-summary-
Node.js.html)
isChildOf function.
Any ideas would be appreciated.
Thanks
Doin' it the other way around could be easier: testing whether the one
element is the parent of the other.
Or you could use the element.contains() method. It seems to be supported
on every browser but mozilla for which you can use this:
http://www.quirksmode.org/blog/archives/2006/01/contains_for_mo.html
Cheers,
/rw