Documento HTML DOM execCommand()
Ejemplo
Poner el texto seleccionado en negrita:
document.execCommand("bold");
Definición y uso
El método execCommand() está en desuso. No lo uses.
La propiedad applets devuelve una HTMLCollection vacía en todos los navegadores nuevos.
El elemento <applet> no es compatible con HTML5.
Alternativas:
Sintaxis
document.execCommand(command, showUI, value)
Parámetros
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. |
Valor devuelto
Escribe | Descripción |
booleano | true si el comando es compatible, de lo contrario false . |