Stats

621 Contributors: 4 Sunday, July 24, 2016
Licensed under: CC-BY-SA
Not affiliated with Stack Overflow
Rip Tutorial: riptutorial@gmail.com
Roadmap: roadmap

execCommand and contenteditable

Syntax

  • bool supported = document.execCommand(commandName, showDefaultUI, valueArgument)

Parameters

commandIdvalue
⋮ Inline formatting commands 
backColorColor value String
bold 
createLinkURL String
fontNameFont family name
fontSize"1", "2", "3", "4", "5", "6", "7"
foreColorColor value String
strikeThrough 
superscript 
unlink 
⋮ Block formatting commands 
delete 
formatBlock"address", "dd", "div", "dt", "h1", "h2", "h3", "h4", "h5", "h6", "p", "pre"
forwardDelete 
insertHorizontalRule 
insertHTMLHTML String
insertImageURL String
insertLineBreak 
insertOrderedList 
insertParagraph 
insertTextText string
insertUnorderedList 
justifyCenter 
justifyFull 
justifyLeft 
justifyRight 
outdent 
⋮ Clipboard commands 
copyCurrently Selected String
cutCurrently Selected String
paste 
⋮ Miscellaneous commands 
defaultParagraphSeparator 
redo 
selectAll 
styleWithCSS 
undo 
useCSS 

Related Examples