This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.
* Some parts of this feature may have varying levels of support.
The InputEvent interface represents an event notifying the user of editable content changes.
InputEvent()Creates an InputEvent object.
This interface inherits properties from its parents, UIEvent and Event.
InputEvent.data Read only
Returns a string with the inserted characters. This may be an empty string if the change doesn't insert text (for example, when deleting characters).
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.
InputEvent.isComposing Read only
Returns a Boolean value indicating if the event is fired after compositionstart and before compositionend.
This interface inherits methods from its parents, UIEvent and Event.
InputEvent.getTargetRanges()Returns an array of StaticRange objects that will be affected by a change to the DOM if the input event is not canceled.
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
InputEvent |
60 | 79 | 31 | 47 | 10.1 | 60 | 31 | 44 | 10.3 | 8.0 | 60 | 10.3 |
InputEvent |
60 | 79 | 31 | 47 | 10.1 | 60 | 31 | 44 | 10.3 | 8.0 | 60 | 10.3 |
data |
60 | 79 | 67 | 47 | 10.1 | 60 | 67 | 44 | 10.3 | 8.0 | 60 | 10.3 |
dataTransfer |
60 | 79 | 67 | 47 | 10.1 | 60 | 67 | 44 | 10.3 | 8.0 | 60 | 10.3 |
getTargetRanges |
60 | 79 | 87 | 47 | 10.1 | 60 | 87 | 44 | 10.3 | 8.0 | 60 | 10.3 |
inputType |
60 | 79 | 66 | 47 | 10.1 | 60 | 66 | 44 | 10.3 | 8.0 | 60 | 10.3 |
isComposing |
60 | 79 | 31 | 47 | 16.4 | 60 | 31 | 44 | 16.4 | 8.0 | 60 | 16.4 |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/InputEvent