JavaScript HTML DOM inputType 事件属性

  • 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;
    }
    
    尝试一下
  • 浏览器支持

    IE/Edge Chrome FireFox Safari Opera
    属性
    inputType
    不支持
    60.0+
    不支持
    支持
    47.0+
  • 语法

    event.inputType
  • 技术细节

    项目 描述
    返回值: 一个字符串,表示已完成的操作类型
  • 相关页面

    JavaScript 参考:Dom Document execCommand() 方法