ExecCommand() du document HTML DOM
Exemple
Mettez le texte sélectionné en gras :
document.execCommand("bold");
Définition et utilisation
La méthode execCommand() est obsolète. Ne l'utilise pas.
La propriété applet renvoie une HTMLCollection vide dans tous les nouveaux navigateurs.
L'élément <applet> n'est pas pris en charge dans HTML5.
Syntaxe
document.execCommand(command, showUI, value)
Paramètres
Parameter | Description |
command |
The name of the command to execute:
"backColor" "bold" "createLink" "copy" "cut" "defaultParagraphSeparator" "delete" "fontName" "fontSize" "foreColor" "formatBlock" "forwardDelete" "insertHorizontalRule" "insertHTML" "insertImage" "insertLineBreak" "insertOrderedList" "insertParagraph" "insertText" "insertUnorderedList" "justifyCenter" "justifyFull" "justifyLeft" "justifyRight" "outdent" "paste" "redo" "selectAll" "strikethrough" "styleWithCss" "subscript" "superscript" "undo" "unlink" "useCSS" |
showUI | A Boolean. Specifies if the UI should be shown or not. |
value | Some commands need a value to be completed. |
Valeur de retour
Taper | La description |
booléen | true si la commande est supportée, sinon false . |