Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

我們的志工尚未將此文章翻譯為 正體中文 (繁體) 版本。加入我們,幫忙翻譯!

The compositionupdate event is fired when a character is added to a passage of text being composed (fires with special characters that require a sequence of keys and other inputs such as speech recognition or word suggestion on mobile).

Bubbles Yes
Cancelable No
Target objects Element
Interface TouchEvent

Properties

Property Type Description
target Read only EventTarget Focused element processing the composition, null if not accessible.
type Read only DOMString The type of event.
bubbles Read only boolean Does the event normally bubble?
cancelable Read only boolean Is it possible to cancel the event?
view Read only WindowProxy Document.defaultView (the window of the document).
detail Read only long (float) 0.
data DOMString (string) The original string being edited, otherwise the empty string. Read only.
locale DOMString (string) The language code for the composition event, if available; otherwise, the empty string. Read only.

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support (Yes)[1] 9.0 (9.0)[2] (Yes) Not supported ?
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support ? 9.0 (9.0)[2] ? ? ?

[1] Not dispatched immediately after compositionstart event.

[2] compositionupdate events are fired before editor contents are actually changed; that is, the value of an editable element has not yet been changed when compositionupdate event handlers are called. Starting in Gecko 12.0 (Firefox 12.0 / Thunderbird 12.0 / SeaMonkey 2.9), input events are fired while editing is underway, after the contents of the element are changed. This lets you get the updated contents while editing is underway.

Gecko also doesn't support the locale attribute for trusted events yet. However, web developers can set this value via initCompositionEvent() when creating untrusted events.

See also

文件標籤與貢獻者

標籤: 
 此頁面的貢獻者: dtapuska, Sebastianz, fscholz, teoli, Sheppy, ethertank, louisremi
 最近更新: dtapuska,