Namespace: getRemoteParent

just.getRemoteParent(childNode, fn, rootContaineropt, includeChildopt) → {Node|null}

Goes up through the childNode parents, until fn returns `true` or a non-Node is found.
Source:
just.js, line 947

Parameters:

NameTypeDefaultDescription
childNode
NodeSome child.
fn
just.getRemoteParent~fnSome custom handler.
rootContainer
[optional]
NodehtmlThe farthest parent.
includeChild
[optional]
booleanfalseIf `true`, it calls fn with childNode too.

Returns:

The current Node when fn returns `true`.
Type
Node or null

Example

just.getRemoteParent(just.body, function () {
    return this.tagName === 'HTML';
}); // returns the <html> Element.

Type Definitions

fn(deepLevelnon-null, rootContainer) → {boolean}

A function that checks if this is the Node that you're looking for.
Source:
just.js, line 917
This:

Node

Parameters:
NameTypeDescription
deepLevel
NumberA counter that indicates how many elements have checked.
rootContainer
NodeThe root container.
Returns:
Type
boolean