# ModelDocumentChangeEvent

typedef

Fired after each [`enqueueChange()` block](module_engine_model_model-Model.md#function-enqueueChange:DEFAULT_BATCH) or the outermost [`change()` block](module_engine_model_model-Model.md#function-change) was executed and the document was changed during that block's execution.

The changes which this event will cover include:

* document structure changes,
* selection changes,
* marker changes.

If you want to be notified about all these changes, then simply listen to this event like this:

```typescript
model.document.on( 'change', () => {
	console.log( 'The document has changed!' );
} );
```

If, however, you only want to be notified about the data changes, then use `change:data` event, which is fired for document structure changes and marker changes (which affects the data).

```typescript
model.document.on( 'change:data', () => {
	console.log( 'The data has changed!' );
} );
```

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-engine/src/model/document.ts#L514)

<a id="properties">

## Properties

<a id="member-args">

### `args: [ batch: Batch ]`

<a id="member-name">

### `name: 'change' | 'change:data'`

#### Value

`object`

## Fired by

* [ModelDocument#change](module_engine_model_document-ModelDocument.md#event-change)
* [ModelDocument#change:data](module_engine_model_document-ModelDocument.md#event-change:data)

---

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