The InputEvent interface represents an event notifying the user of editable content changes.
On this page
InputEvent
Constructor
-
InputEvent() -
Creates an
InputEventobject.
Instance properties
This interface inherits properties from its parents, UIEvent and Event.
InputEvent.dataRead 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.dataTransferRead only-
Returns a
DataTransferobject containing information about richtext or plaintext data being added to or removed from editable content. InputEvent.inputTypeRead only-
Returns the type of change for editable content such as, for example, inserting, deleting, or formatting text.
InputEvent.isComposingRead only-
Returns a
Booleanvalue indicating if the event is fired aftercompositionstartand beforecompositionend.
Instance 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
Browser compatibility
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
InputEvent |
60 | 79 | 31 | No | 47 | 60 | 60 | 31 | 44 | 8.0 | ||
InputEvent |
60 | 79 | 31 | No | 47 | 10.1 | 60 | 60 | 31 | 44 | 10.3 | 8.0 |
data |
60 | 79 | 67 | No | 47 | 10.1 | 60 | 60 | 67 | 44 | 10.3 | 8.0 |
dataTransfer |
60 | 79 | 67 | No | 47 | 10.1 | 60 | 60 | 67 | 44 | 10.3 | 8.0 |
getTargetRanges |
60 | 79 | 87 | No | 47 | 10.1 | 60 | 60 | 87 | 44 | 10.3 | 8.0 |
inputType |
60 | 79 | 66 | No | 47 | 10.1 | 60 | 60 | 66 | 44 | 10.3 | 8.0 |
isComposing |
60 | 79 | 31 | No | 47 | 16.4 | 60 | 60 | 31 | 44 | 16.4 | 8.0 |
See also
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/InputEvent