这是
实验性技术
检查
浏览器兼容性表格
要小心谨慎在生产中使用这之前。
InputEvent()
构造函数创建新
InputEvent
.
event = new InputEvent(typeArg, inputEventInit);
DOMString
表示事件的名称。
是
InputEventInit
字典,拥有以下字段:
inputType
: (Optional) A string specifying the type of change for editible content such as, for example, inserting, deleting, or formatting text.
data
: (Optional) A string containing characters to insert. This may be an empty string if the change doesn't insert text (such as when deleting characters, for example).
dataTransfer
: (Optional) A
DataTransfer
object containing information about richtext or plaintext data being added to or removed from editible content.
isComposing
: (Optional) A boolean indicating that the event is part of a composition session, meaning it is after a
compositionstart
event but before a
compositionend
event. The default is
false
.
ranges
: (Optional) An array of static ranges that will be affected by a change to the DOM if the input event is not canceled.
InputEventInit
字典还接受字段来自
UIEventInit
和来自
EventInit
字典。
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
InputEvent()
构造函数
|
Chrome 60 | Edge 79 | Firefox 31 | IE No | Opera 47 | Safari ? | WebView Android 60 | Chrome Android 60 | Firefox Android 31 | Opera Android 44 | Safari iOS ? | Samsung Internet Android 8.0 |
完整支持
不支持
兼容性未知
实验。期望将来行为有所改变。
InputEvent
,构造对象的接口。
InputEvent
InputEvent()