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
InputEventobject.
Properties
This interface inherits properties from its parents, UIEvent and Event.
InputEvent.dataRead only- Returns a
DOMStringwith the inserted characters. This may be an empty string if the change doesn't insert text (such as when deleting characters, for example). 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. See the property page for a complete list of input types.
InputEvent.isComposingRead only- Returns a
Booleanvalue indicating if the event is fired aftercompositionstartand 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
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
| Desktop | Mobile | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Basic support | Chrome Full support 60 | Edge ? | Firefox Full support 31 | IE No support No | Opera Full support 47 | Safari Full support 10.1 | WebView Android Full support 60 | Chrome Android Full support 60 | Edge Mobile ? | Firefox Android Full support 31 | Opera Android Full support 47 | Safari iOS Full support 10.1 | Samsung Internet Android ? |
InputEvent() constructor | Chrome Full support 60 | Edge ? | Firefox Full support 31 | IE No support No | Opera Full support 47 | Safari ? | WebView Android Full support 60 | Chrome Android Full support 60 | Edge Mobile ? | Firefox Android Full support 31 | Opera Android Full support 47 | Safari iOS ? | Samsung Internet Android ? |
data | Chrome Full support 60 | Edge ? | Firefox No support No | IE No support No | Opera Full support 47 | Safari No support No | WebView Android Full support 60 | Chrome Android Full support 60 | Edge Mobile ? | Firefox Android No support No | Opera Android Full support 47 | Safari iOS No support No | Samsung Internet Android ? |
dataTransfer | Chrome Full support 60 | Edge ? | Firefox No support No | IE No support No | Opera Full support 47 | Safari No support No | WebView Android Full support 60 | Chrome Android Full support 60 | Edge Mobile ? | Firefox Android No support No | Opera Android Full support 47 | Safari iOS No support No | Samsung Internet Android ? |
getTargetRanges | Chrome Full support 60 | Edge No support No | Firefox No support No | IE No support No | Opera Full support 47 | Safari Full support 10.1 | WebView Android Full support 60 | Chrome Android Full support 60 | Edge Mobile No support No | Firefox Android No support No | Opera Android Full support 47 | Safari iOS Full support 10.1 | Samsung Internet Android ? |
inputType | Chrome Full support 60 | Edge ? | Firefox No support No | IE No support No | Opera Full support 47 | Safari Full support 10.1 | WebView Android Full support 60 | Chrome Android Full support 60 | Edge Mobile ? | Firefox Android No support No | Opera Android Full support 47 | Safari iOS Full support 10.1 | Samsung Internet Android ? |
isComposing | Chrome Full support 60 | Edge ? | Firefox Full support 31 | IE No support No | Opera Full support 47 | Safari No support No | WebView Android Full support 60 | Chrome Android Full support 60 | Edge Mobile ? | Firefox Android Full support 31 | Opera Android Full support 47 | Safari iOS No support No | Samsung Internet Android ? |
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.