JavaScript execCommand and contenteditable

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

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 


Got any JavaScript Question?