InputEvent inputType 属性

定义和用法

inputType 属性返回由事件完成的更改类型。

可能的值:

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

实例

返回事件的输入类型:

function myFunction(event) {
  var x = event.inputType;
}

亲自试一试

语法

event.inputType

技术细节

返回值:字符串值,指示完成的动作类型。

浏览器支持

属性ChromeIEFirefoxSafariOpera
inputType60不支持不支持支持47

相关页面

Document execCommand() 方法