NEWCKEditor AI is here! Register for our AI in Enterprise webinar.
Sign up (with export icon)

utils/dom/getcommonancestor

Api-module iconmodule

Functions

  • Chevron-right icon

    getCommonAncestor( nodeA, nodeB ) → Node | null

    Searches and returns the lowest common ancestor of two given nodes.

    Parameters

    nodeA : Node

    First node.

    nodeB : Node

    Second node.

    Returns

    Node | null

    Lowest common ancestor of both nodes or null if nodes do not have a common ancestor.