SCEditor

findCommonAncestor

findCommonAncestor(nodeA, nodeB) Since: 1.3.0

Finds the first common parent of two DOM nodes.

Syntax

var commonAncestor = sceditor.dom.findCommonAncestor(nodeA, nodeB);

Parameters

nodeA
Type: Node

nodeB
Type: Node

Return

Type: Node

Returns null if there is no common ancestor of the two nodes.