# DowncastAttributeEvent

typedef

Fired in the following cases:

* when an attribute has been added, changed, or removed from a node,
* when a node with an attribute is inserted,
* when a collapsed model selection attribute is converted.

`attribute` is a namespace for a class of events. Names of actually called events follow this pattern: `attribute:attributeKey:name`. `attributeKey` is the key of added/changed/removed attribute. `name` is either `'$text'` if change was on [a text node](module_engine_model_text-ModelText.md), or the [name](module_engine_model_element-ModelElement.md#member-name) of element which attribute has changed.

This way listeners can either listen to a general `attribute:bold` event or specific event (for example `attribute:src:imageBlock`).

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-engine/src/conversion/downcastdispatcher.ts#L846)

<a id="type-parameters">

## Type parameters

### `TItem: ModelItem | ModelSelection | ModelDocumentSelection`

#### Value

`DowncastEvent<'attribute', TItem>`

## Fired by

* [DowncastDispatcher#attribute](module_engine_conversion_downcastdispatcher-DowncastDispatcher.md#event-attribute)

---

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