parentnode parentnode javascript 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;
}