Documentation

editor.execCommand()

Editor object exposes an execCommand method to run commands that manipulate the current editable region.

Syntax

editor.execCommand(command,optionalValue)

command

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

value

Some commands need a value to be completed.

NameDescription
boldToggles bold on/off for the selection or at the insertion point.
italicToggles italics on/off for the selection or at the insertion point.
underlineToggles underline on/off for the selection or at the insertion point.
strikeToggles strikethrough on/off for the selection or at the insertion point.
fontnameChanges the font name for the selection or at the insertion point. This requires a font name string (like "Arial") as a value argument.
fontsizeChanges the font size for the selection or at the insertion point. This requires an integer as a value argument.
forecolorChanges a font color for the selection or at the insertion point. This requires a hexadecimal color value string as a value argument.
backcolorChanges the document background color. It affects the background color of the containing block instead. This requires a color value string to be passed in as a value argument.
superscriptToggles superscript on/off for the selection or at the insertion point.
subscriptToggles subscript on/off for the selection or at the insertion point.
removeformatRemoves all formatting from the current selection.
justifyleftJustifies the selection or insertion point to the left.
justifycenterCenters the selection or insertion point.
justifyrightRight-justifies the selection or the insertion point.
justifyfullJustifies the selection or insertion point.
indentIndents the line containing the selection or insertion point.
outdentOutdents the line containing the selection or insertion point.
insertblockquoteCreates a blockquote for the selection or at the insertion point.
insertorderedlistCreates a numbered ordered list for the selection or at the insertion point.
insertunorderedlistCreates a bulleted unordered list for the selection or at the insertion point.
inserthorizontalruleInserts a <hr/> element at the insertion point, or replaces the selection with it.
insertdateInserts the current date and time at the insertion point.
codeSwitchs to Source Code Mode to edit the HTML Directly.
fullscreenenterMakes the Rich Text Editor enter full-screen mode.
fullscreenexitMakes the Rich Text Editor exit full-screen mode.
selectallSelects all of the content of the editable region.
newdocCreates a new document.
saveSaves the active content in the editor's content area.
undoUndoes the last executed command.
redoRedoes the previous undo command.
insertlinkAdds a link to the selection.
insertcharsInserts a special character from a predefined list.
inserttableInserts a table into your document.
insertimageInserts an image at the selected position in the editor and allows you to set it's properties.
insertvideoInserts a video at the selected position.
insertcodeAllows you to easily post syntax highlighted code.
html2pdfSaves the active content in the editor's content area to a PDF file.
printPrints the current page.
previewPeviews the current page.
findFinds and allows replacements of text in the editor's content area.