# utils/dom/getactiveelement

module

<a id="functions">

## Functions

<a id="function-getActiveElement">

### `getActiveElement( node ) → Element | null`

Returns the focused element in the tree the given node lives in.

The shadow-aware replacement for `document.activeElement`, which reports the host of a shadow tree rather than the focused element inside it. Pass any node from the tree whose focus is in question – typically the element being checked itself. Works for open and closed roots alike.

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

#### Parameters

* `node: Node`

  The node whose tree's active element should be returned.

#### Returns

* `Element | null`

---

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