Hallo!
Um auf indirekte Parents (Groß- bzw. Groß-groß-Eltern und deren Vorfahren) zu prüfen:
var c = [Object child];
var p = [Object parent]
function isRelativeParent(c, p) {
var e = c;
while (e != document.body && e.parentNode) {
e = e.parentNode;
if (e == p) { return true; }
}
return false;
}
Gruß, LX
--
X-Self-Code: sh:( fo:) ch:~ rl:° br:> n4:& ie:% mo:) va:) de:] zu:) fl:{ ss:) ls:~ js:|
X-Self-Code-Url: http://emmanuel.dammerer.at/selfcode.html
X-Will-Answer-Email: Unusual
X-Please-Search-Archive-First: Absolutely Yes
X-Self-Code: sh:( fo:) ch:~ rl:° br:> n4:& ie:% mo:) va:) de:] zu:) fl:{ ss:) ls:~ js:|
X-Self-Code-Url: http://emmanuel.dammerer.at/selfcode.html
X-Will-Answer-Email: Unusual
X-Please-Search-Archive-First: Absolutely Yes