Return the type of input the event was about:
The inputType property returns the type of change that was done with the event.
This property is not fully supported, and can change before the final release.
<!DOCTYPE html> <html> <body> <input type="text" id="myInput" oninput="myFunction(event)"> <p>The type of action:<span id="demo"></span></p> <script> function myFunction(event) {/*from www . j a va 2 s.c om*/ document.getElementById("demo").innerHTML = event.inputType; } </script> </body> </html>
The inputType property returns the type of change that was done by the event.
Possible values:
"insertText"//from w w w . j a v a 2 s . com "insertReplacementText" "insertLineBreak" "insertParagraph" "insertOrderedList" "insertUnorderedList" "insertHorizontalRule" "insertFromYank" "insertFromDrop" "insertFromPaste" "insertTranspose" "insertCompositionText" "insertFromComposition" "insertLink" "deleteByComposition" "deleteCompositionText" "deleteWordBackward" "deleteWordForward" "deleteSoftLineBackward" "deleteSoftLineForward" "deleteEntireSoftLine" "deleteHardLineBackward" "deleteHardLineForward" "deleteByDrag" "deleteByCut" "deleteByContent" "deleteContentBackward" "deleteContentForward" "historyUndo" "historyRedo" "formatBold" "formatItalic" "formatUnderline" "formatStrikethrough" "formatSuperscript" "formatSubscript" "formatJustifyFull" "formatJustifyCenter" "formatJustifyRight" "formatJustifyLeft" "formatIndent" "formatOutdent" "formatRemove" "formatSetBlockTextDirection" "formatSetInlineTextDirection" "formatBackColor" "formatFontColor" "formatFontName"
The inputType property returns a String indicating what kind of action that was done.