# utils/dom/getcommonancestor

module

<a id="functions">

## Functions

<a id="function-getCommonAncestor">

### `getCommonAncestor( nodeA, nodeB ) → Node | null`

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

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-utils/src/dom/getcommonancestor.ts#L19)

#### 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.

---

Full index of the CKEditor 5 API reference: [llms.txt](llms.txt)
