InputEvent

这是一个实验中的功能
此功能某些浏览器尚在开发中,请参考浏览器兼容性表格以得到在不同浏览器中适合使用的前缀。由于该功能对应的标准文档可能被重新修订,所以在未来版本的浏览器中该功能的语法和行为可能随之改变。

<

InputEvent 接口用来构造和字符输入相关的事件对象。

构造函数

InputEvent()
创建一个 InputEvent 对象。

属性

除继承自 UIEventEvent 接口的属性外,还有以下属性:

InputEvent.data 只读
返回当前输入的字符串,如果是删除操作,则该值为空字符串。
InputEvent.isComposing只读
返回一个布尔值,表明该事件是在触发 compositionstart 事件之后且触发 compositionend 事件之前触发的,也就是表明当前输入的字符是输入法的中途输入。

方法

除继承自 UIEventEvent 接口的方法外,没有其它自身方法。

规范

Specification Status Comment
Document Object Model (DOM) Level 3 Events Specification
InputEvent
Obsolete Initial definition.

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
InputEvent
Experimental
Chrome Full support 60Edge Full support 79Firefox Full support 31IE No support NoOpera Full support 47Safari Full support 10.1WebView Android Full support 60Chrome Android Full support 60Firefox Android Full support 31Opera Android Full support 44Safari iOS Full support 10.3Samsung Internet Android Full support 8.0
InputEvent() constructor
Experimental
Chrome Full support 60Edge Full support 79Firefox Full support 31IE No support NoOpera Full support 47Safari ? WebView Android Full support 60Chrome Android Full support 60Firefox Android Full support 31Opera Android Full support 44Safari iOS ? Samsung Internet Android Full support 8.0
data
Experimental
Chrome Full support 60Edge Full support 79Firefox Full support 67IE No support NoOpera Full support 47Safari No support NoWebView Android Full support 60Chrome Android Full support 60Firefox Android Full support 67Opera Android Full support 44Safari iOS No support NoSamsung Internet Android Full support 8.0
dataTransfer
Experimental
Chrome Full support 60Edge Full support 79Firefox Full support 67IE No support NoOpera Full support 47Safari No support NoWebView Android Full support 60Chrome Android Full support 60Firefox Android Full support 67Opera Android Full support 44Safari iOS No support NoSamsung Internet Android Full support 8.0
getTargetRanges
Experimental
Chrome Full support 60Edge Full support 79Firefox No support NoIE No support NoOpera Full support 47Safari Full support 10.1WebView Android Full support 60Chrome Android Full support 60Firefox Android No support NoOpera Android Full support 44Safari iOS Full support 10.3Samsung Internet Android Full support 8.0
inputType
Experimental
Chrome Full support 60Edge Full support 79Firefox Full support 66IE No support NoOpera Full support 47Safari Full support 10.1WebView Android Full support 60Chrome Android Full support 60Firefox Android Full support 66Opera Android Full support 44Safari iOS Full support 10.3Samsung Internet Android Full support 8.0
isComposing
Experimental
Chrome Full support 60Edge Full support 79Firefox Full support 31IE No support NoOpera Full support 47Safari No support NoWebView Android Full support 60Chrome Android Full support 60Firefox Android Full support 31Opera Android Full support 44Safari iOS No support NoSamsung Internet Android Full support 8.0

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.

相关链接