HTML-DOM-Dokument execCommand()
Beispiel
Ausgewählten Text fett formatieren:
document.execCommand("bold");
Definition und Verwendung
Die Methode execCommand() ist veraltet. Benutze es nicht.
Die Applets-Eigenschaft gibt in allen neuen Browsern eine leere HTMLCollection zurück.
Das <applet>-Element wird in HTML5 nicht unterstützt.
Syntax
document.execCommand(command, showUI, value)
Parameter
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. |
Rückgabewert
Typ | Beschreibung |
Boolesch | true wenn der Befehl unterstützt wird, sonst false . |