input
This page has been flagged with the following issues:
High-level issues:
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 onchange 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.
The pEvtObj parameter is required for the following interfaces:
- HTMLAnchorEvents2
- HTMLAreaEvents2
- HTMLButtonElementEvents2
- HTMLControlElementEvents2
- HTMLDocumentEvents2
- HTMLElementEvents2
- HTMLFormElementEvents2
- HTMLImgEvents2
- HTMLFrameSiteEvents2
- HTMLInputFileElementEvents2
- HTMLInputImageEvents2
- HTMLInputTextElementEvents2
- HTMLLabelEvents2
- HTMLLinkElementEvents2
- HTMLMapEvents2
- HTMLMarqueeElementEvents2
- HTMLObjectElementEvents2
- HTMLOptionButtonElementEvents2
- HTMLScriptEvents2
- HTMLSelectElementEvents2
- HTMLStyleElementEvents2
- HTMLTableEvents2
- HTMLTextContainerEvents2
- HTMLWindowEvents2
- HTMLDocumentEvents4
- HTMLElementEvents4
Syntax
Standards information
Event handler parameters
- pEvtObj [in]
- Type: IHTMLEventObj
See also
Related pages (MSDN)
aabbracronymaddressappletareaaudiobbasebaseFontbdobgSoundbigbodyblockQuotebrbuttoncanvascaptioncentercitecodecolcolGroupcommentcustomdddeldfndirdivdldocumentdtemembedfieldSetfontformframeframeSetheadhnhrhtmliiframeimginput type=buttoninput type=checkboxinput type=fileinput type=hiddeninput type=imageinput type=passwordinput type=radioinput type=resetinput type=submitinput type=textinsisIndexkbdlabellegendlilinklistingmapmarqueemediamenumetanextIDnoBRnoFramesnoScriptobjectoloptGroupoptionpparamplainTextpreqrtrubyssampscriptselectsmallsourcespanstrikestrongstylesubsuptabletBodytdtextAreatFootthtHeadtitletrttuulvarwbrvideowindowxmp
This article contains content originally from external sources.
Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]
This tool helps to make and review comments inline.
How to Use
insert instructions, with images, here