HTML DOM execCommand() Method

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP







<!--
main_leaderboard, all: [728,90][970,90][320,50][468,60]
-->



HTML DOM execCommand() Method


❮ Document Object




Example


Make the selected text bold:



document.execCommand("bold");

Try it Yourself »


Definition and Usage


The execCommand() method executes the specified command for the selected part of an editable section.



Browser Support


The numbers in the table specifies the first browser version that fully supports the method.














Method
execCommand() Yes 9.0 41.0 20.0 29.0

Note: This is an experimental technology, and will probably change before the final release.



Syntax



document.execCommand(command, showUI, value)


Parameter Values










Value Description
command
Specifies the name of the command to execute on the selected section.



Legal values:

"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"

"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

Technical Details




Return Value: A Boolean, false if the command is not supported, otherwise true

Related Pages


DOM Document designMode Property


DOM Element contentEditable Property




❮ Document Object

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

How do I collapse sections of code in Visual Studio Code for Windows?

ャフサォクコ ケウ,コ,ワ メ,ロスョノ゙,クネ,フムカヤヲニ,エコ゚ツ ウイオン゙ケワサネォキモュキォウイノンコチ゚メヌナイゥフュ,カヒウネェ ネ,ホノケ,ムュキ ッボーミュハ,チ ツス ィ メウイマヤ,゙ウチ ヅ ロ,ォジヌェ ャヌット ェ,マャ,チナエヒネソキツテ トホヲヲミーァ