data
只读特性在
CompositionEvent
interface returns the characters generated by the input method that raised the event; its exact nature varies depending on the type of event that generated the
CompositionEvent
对象。
myData = CompositionEvent.data
A
DOMString
representing the event data:
compositionstart
events, this is the currently selected text that will be replaced by the string being composed. This value doesn't change even if content changes the selection range; rather, it indicates the string that was selected when composition started.
compositionupdate
, this is the string as it stands currently as editing is ongoing.
compositionend
events, this is the string as committed to the editor.
| 规范 | 状态 | 注释 |
|---|---|---|
|
DOM (文档对象模型) 3 级事件规范
The definition of 'data' in that specification. |
过时 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
data
|
Chrome Yes | Edge 12 | Firefox 9 | IE Yes | Opera No | Safari Yes | WebView Android Yes | Chrome Android Yes | Firefox Android 9 | Opera Android Yes | Safari iOS Yes | Samsung Internet Android Yes |
完整支持
不支持
CompositionEvent
data
locale