This page is In Progress

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

input

Overview Table

Synchronous No
Bubbles No
Target dom/Element
Cancelable No
Default action ?
## Examples

The following script queries the event target as the text in a textArea is changed.

<script type="text/javascript">
function handleInput(ev) {
    alert(ev.target.value);
}
window.onload = function() {
    document.getElementById('myTextArea').addEventListener('input',handleInput,false);
}
</script>
<textarea id="myTextArea">Edit this text.</textarea>

Notes

Remarks

You can use the oninput to detect when the contents of a textArea, input type=text, or input type=password have changed. This event occurs immediately after modification, unlike the change event, which occurs when the element loses focus. To invoke this event, do one of the following:

  • Enter some text into a form field.
  • Cut, delete, or paste content.
  • Navigate to another document.

Syntax

Standards information

See also

External resources

Attributions