InputEvent inputType Property

Example

Return the type of input the event was about:

function myFunction(event) {
  let text = event.inputType;
}
Try it Yourself »

Description

The inputType property returns the type of change that was done by the event.

The inputType property is read-only.

Possible values:

"insertText"
"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"


Syntax

event.inputType

Technical Details

Return Value: A String.
The name of the input action

Browser Support

event.inputType is a DOM Level 4 (2015) feature.

It is supported in all modern browsers:

Chrome Edge Firefox Safari Opera
Yes Yes Yes Yes Yes

event.inputType is not supported in Internet Explorer 11 (or earlier).



Copyright 1999-2023 by Refsnes Data. All Rights Reserved.