W3cubDocs

/Web APIs

InputEvent

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

Event UIEvent InputEvent

Constructor

InputEvent()

Creates an InputEvent object.

Instance properties

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.

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
10.1The inputEventInit parameter is not supported. See bug 170416.
60 60 31 44
10.3The inputEventInit parameter is not supported. See bug 170416.
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