此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。
compositionupdate
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年7月.
compositionupdate 事件触发于字符被输入到一段文字的时候(这些可见字符的输入可能需要一连串的键盘操作、语音识别或者点击输入法的备选词)
| Bubbles | Yes |
| Cancelable | No |
| Target objects | Element |
| Interface | TouchEvent |
In this article
属性
| Property | Type | Description |
|---|---|---|
target只读 | EventTarget | 焦点所在的,处理文字输入的元素。 |
type只读 | DOMString | The type of event. |
bubbles只读 | boolean | Does the event normally bubble? |
cancelable只读 | boolean | Is it possible to cancel the event? |
view只读 | WindowProxy | Document.defaultView (thewindow of the document). |
detail只读 | long (float) | 0. |
data只读 | DOMString (string) | 要被替换掉的字符串,如果输入时没有字符串被选,则为空字符串。只读。 |
locale只读 | DOMString (string) | 输入事件的语言代号,或者空字符串。只读。 |
规范
| Specification |
|---|
| UI Events> # event-type-compositionupdate> |