Dokumen HTML DOM execCommand()
Contoh
Buat teks yang dipilih menjadi tebal:
document.execCommand("bold");
Definisi dan Penggunaan
Metode execCommand() tidak digunakan lagi. Jangan gunakan itu.
Properti applet mengembalikan HTMLCollection kosong di semua browser baru.
Elemen <applet> tidak didukung di HTML5.
Sintaksis
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. |
Nilai Kembali
Jenis | Keterangan |
Boolean | true jika perintah didukung, jika tidak false . |