Documento HTML DOM execCommand()
Esempio
Rendi il testo selezionato in grassetto:
document.execCommand("bold");
Definizione e utilizzo
Il metodo execCommand() è deprecato. Non usarlo.
La proprietà delle applet restituisce una HTMLCollection vuota in tutti i nuovi browser.
L'elemento <applet> non è supportato in HTML5.
Sintassi
document.execCommand(command, showUI, value)
Parametri
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. |
Valore di ritorno
Tipo | Descrizione |
booleano | true se il comando è supportato, altrimenti false . |