# ElementApi

interface

Interface describing an editor that replaced a DOM element (was "initialized on an element").

Such an editor should provide a method to [update the replaced element with the current data](#function-updateSourceElement).

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-core/src/editor/utils/elementapimixin.ts#L81)

<a id="properties">

## Properties

<a id="member-sourceElement">

### `sourceElement: HTMLElement | undefined` _(readonly)_

The element on which the editor has been initialized.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-core/src/editor/utils/elementapimixin.ts#L88)

<a id="methods">

## Methods

<a id="function-updateSourceElement">

### `updateSourceElement( data? ) → void`

Updates the [editor source element](#member-sourceElement)'s content with the data if the [`updateSourceElementOnDestroy`](module_core_editor_editorconfig-EditorConfig.md#member-updateSourceElementOnDestroy) configuration option is set to `true`.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-core/src/editor/utils/elementapimixin.ts#L97)

#### Parameters

* `data?: string`

  Data that the [editor source element](#member-sourceElement) should be updated with.

#### Returns

* `void`

---

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