input
Overview Table
Synchronous | No |
---|---|
Bubbles | No |
Target | dom/Element |
Cancelable | No |
Default action | ? |
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
Microsoft Developer Network: [Windows Internet Explorer API reference Article]