Attribut inputType de l'événement InputEvent

Définition et utilisation

inputType L'attribut retourne le type de modification effectuée par l'événement.

Valeurs possibles :

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

Exemple

Renvoie le type d'entrée de l'événement :

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

Essayez-le vous-même

Syntaxe

event.inputType

Détails techniques

Valeur de retour : Valeur de chaîne, indiquant le type d'action terminée.

Support du navigateur

Attribut Chrome IE Firefox Safari Opera
inputType 60 Non supporté Non supporté Supporté 47

Pages associées

Méthode execCommand() du Document