InputEvent

The InputEvent interface represents an event notifying the user of editable content changes.

Constructor

InputEvent()

Creates an InputEvent object.

Properties

This interface inherits properties from its parents, UIEvent and Event.

InputEvent.dataRead 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.dataTransferRead only

Returns a DataTransfer object 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 Boolean value indicating if the event is fired after compositionstart and before compositionend.

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
10.1
60
60
31
44
10.3
8.0
InputEvent
60
79
31
No
47
10.1
The inputEventInit parameter is not supported. See bug 170416.
60
60
31
44
10.3
The inputEventInit parameter is not supported. See bug 170416.
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
75-87
No
47
10.1
60
60
87
79-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
No
60
60
31
44
No
8.0

See also

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/InputEvent