Occurs when some characters are entered into an element.
Note: The textInput event is supported in Internet Explorer from version 9.This event is supported by the input:password, input:search, input:text and textarea elements, and by elements in contentEditable mode. onchange event, but it occurs after the element loses the focus, not immediately after the modification.
How to register:
object.addEventListener ("textInput", handler, useCapture);
This event cannot be registered in HTML.
The event object is accessible to all event handlers in all browsers. The properties of the event object contain additional information about the current event. To get further details about these properties and the possible event handler registration methods, please see the page for the event object.
Actions that invoke the textInput event:
- Entering some text into an element.
Actions that do not invoke the textInput event:
The order of events related to the textInput event:
|Entering some text into an element.|
Example HTML code 1:
This example shows how to use the oninput, onpropertychange and textInput events to detect when the contents of a textarea element is changed. Both the oninput and onpropertychange events are buggy in Internet Explorer 9, they are not fired when characters are deleted only when inserted.
Did you find this example helpful?
User Contributed Comments