---
url: /api/formats/interactions/src/functions/initInPlaceEdit.md
---
[pantoken-root](../../../../index.md) / [formats/interactions/src](../index.md) / initInPlaceEdit

# Function: initInPlaceEdit()

> **initInPlaceEdit**(`host`, `dispatchOn`, `options?`): `void`

Wire a contenteditable field for click-to-edit commit/revert behaviour.
Enter commits, Escape reverts; blur also commits if the value changed.
Fires a bubbling `change` CustomEvent with `detail.value` on commit.
The optional input type configures the editing hint only; consumers validate committed values.

CSS:  host = .instui-in-place-edit element (which IS contenteditable)
WC:   host = shadow .instui-in-place-edit span

## Parameters

### host

`HTMLElement`

### dispatchOn

`HTMLElement`

### options?

[`InPlaceEditOptions`](../interfaces/InPlaceEditOptions.md) = `{}`

## Returns

`void`
