blockly > utils > dom > containsNode

utils.dom.containsNode() function

Use native 'contains' DOM method.

Whether a node contains another node.

Signature:

export declare function containsNode(parent: Node, descendant: Node): boolean;

Parameters

Parameter Type Description
parent Node The node that should contain the other node.
descendant Node The node to test presence of.

Returns:

boolean

Whether the parent node contains the descendant node.