javascript parentnode of parentnode code example
Example: parentnode parentnode
function nthParent(element, n) {
while(n-- && element)
element = element.parentNode;
return element;
}
function nthParent(element, n) {
while(n-- && element)
element = element.parentNode;
return element;
}