This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The InputEvent
interface represents an event notifying of editable content change.
Constructor
InputEvent()
- Creates an
InputEvent
object.
Properties
This interface inherits properties from its parents, UIEvent
and Event
.
InputEvent.data
Read only- Returns a
DOMString
with the inserted characters. This may be an empty string if the change doesn't insert text (such as when deleting characters, for example). InputEvent.dataTransfer
Read only- Returns a
DataTransfer
object containing information about richtext or plaintext data being added to or removed from editable content. InputEvent.inputType
Read only- Returns the type of change for editable content such as, for example, inserting, deleting, or formatting text. See the property page for a complete list of input types.
InputEvent.isComposing
Read only- Returns a
Boolean
value indicating if the event is fired aftercompositionstart
and beforecompositionend
.
Methods
This interface inherits methods from its parents, UIEvent
and Event
.
InputEvent.getTargetRanges()
- Returns an array of static ranges that will be affected by a change to the DOM if the input event is not canceled.
Specifications
Specification | Status | Comment |
---|---|---|
Input Events Level 2 The definition of 'InputEvent' in that specification. |
Working Draft | Initial definition. |
Browser compatibility
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | 60 | 31.0 (31.0) | No support | 47 | 10.1 |
data |
60 | No support | No support | 47 | No support |
dataTransfer |
60 | No support | No support | 47 | No support |
getTargetRanges() |
60 | No support | No support | 47 | No support |
inputType |
60 | No support | No support | 47 | 10.1 |
isComposing() |
60 | 31.0 (31.0) | No support | 47 | No support |
Feature | Android Webview | Chrome for Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | 60 | 60 | 31.0 (31.0) | No support | 47 | 10.1 |
data |
60 | 60 | No support | No support | 47 | No support |
dataTransfer |
60 | 60 | No support | No support | 47 | No support |
getTargetRanges() |
60 | 60 | No support | No support | 47 | No support |
inputType |
60 | 60 | No support | No support | 47 | 10.1 |
isComposing() |
60 | 60 | 31.0 (31.0) | No support | 47 | No support |