switched to designmode, the document object exposes the execcommand method which
allows one to run commands to manipulate the contents of the editable region.
most commands affect the document\"s selection (bold, italics, etc), while others
insert new elements (adding a link) or affect an entire line (indenting). when
the currently active editable element.
backcolor
changes
the document background color. in stylewithcss mode, it affects the background
color of the containing block instead. this requires a color value string to be
passed in as a value argument. (internet explorer uses this to set text
background color.)
bold
toggles
bold on/off for the selection or at the insertion point. (internet explorer uses
the strong tag instead of b.)
contentreadonly
makes
the content document either read-only or editable. this requires a boolean
true/false to be passed in as a value argument. (not supported by internet
explorer.)
copy
copies
the current selection to the clipboard. clipboard capability must be enabled in
the user.js preference file. see
createlink
creates
an anchor link from the selection, only if there is a selection. this requires
the href uri string to be passed in as a value argument. the uri must contain at
least a single character, which may be a white space. (internet explorer will
create a link with a null uri value.)
cut
cuts
the current selection and copies it to the clipboard. clipboard capability must
be enabled in the user.js preference file. see
decreasefontsize
adds
a small tag around the selection or at the insertion point. (not supported by
internet explorer.)
delete
deletes
the current selection.
enableinlinetableediting
enables
or disables the table row and column insertion and deletion controls. (not
supported by internet explorer.)
enableobjectresizing
enables
or disables the resize handles on images and other resizable objects. (not
supported by internet explorer.)
fontname
changes
the font name for the selection or at the insertion point. this requires a font
name string (\"arial\" for example) to be passed in as a value argument.
fontsize
changes
the font size for the selection or at the insertion point. this requires an html
font size (1-7) to be passed in as a value argument.
forecolor
changes
a font color for the selection or at the insertion point. this requires a color
value string to be passed in as a value argument.
formatblock
adds
an html block-style tag around the line containing the current selection,
replacing the block element containing the line if one exists (in firefox,
blockquote is the exception - it will wrap any containing block element).
requires a tag-name string to be passed in as a value argument. virtually all
block style tags can be used (eg. \"h1\", \"p\", \"dl\", \"blockquote\"). (internet
explorer supports only heading tags h1 - h6, address, and pre, which must also
include the tag delimiters < >, such as \"\".)
forwarddelete
deletes
the character ahead of the cursor\"s
position. it is the same as hitting the delete key.
heading
adds
a heading tag around a selection or insertion point line. requires the tag-name
string to be passed in as a value argument (i.e. \"h1\", \"h6\"). (not supported by
internet explorer and safari.)
hilitecolor
changes
the background color for the selection or at the insertion point. requires a
color value string to be passed in as a value argument. usecss must be turned on
for this to function. (not supported by internet explorer.)
increasefontsize
adds
a big tag around the selection or at the insertion point. (not supported by
internet explorer.)
indent
indents
the line containing the selection or insertion point. in firefox, if the
selection spans multiple lines at different levels of indentation, only the
least indented lines in the selection will be indented.
insertbronreturn
controls
whether the enter key inserts a br tag or splits the current block element into
two. (not supported by internet explorer.)
inserthorizontalrule
inserts
a horizontal rule at the insertion point (deletes selection).
inserthtml
inserts
an html string at the insertion point (deletes selection). requires a valid html
string to be passed in as a value argument. (not supported by internet
explorer.)
insertimage
inserts
an image at the insertion point (deletes selection). requires the image src uri
string to be passed in as a value argument. the uri must contain at least a
single character, which may be a white space. (internet explorer will create a
link with a null uri value.)
insertorderedlist
creates
a numbered ordered list for the selection or at the insertion point.
insertunorderedlist
creates
a bulleted unordered list for the selection or at the insertion point.
insertparagraph
inserts
a paragraph around the selection or the current line. (internet explorer inserts
a paragraph at the insertion point and deletes the selection.)
inserttext
inserts
the given plain text at the insertion point (deletes selection).
italic
toggles
italics on/off for the selection or at the insertion point. (internet explorer
uses the em tag instead of i.)
justifycenter
centers
the selection or insertion point.
justifyfull
justifies
the selection or insertion point.
justifyleft
justifies
the selection or insertion point to the left.
justifyright
right-justifies
the selection or the insertion point.
outdent
outdents
the line containing the selection or insertion point.
paste
pastes
the clipboard contents at the insertion point (replaces current selection).
clipboard capability must be enabled in the user.js preference file.
see
redo
redoes
the previous undo command.
removeformat
removes
all formatting from the current selection.
selectall
selects
all of the content of the editable region.
strikethrough
toggles
strikethrough on/off for the selection or at the insertion point.
subscript
toggles
subscript on/off for the selection or at the insertion point.
superscript
toggles
superscript on/off for the selection or at the insertion point.
underline
toggles
underline on/off for the selection or at the insertion point.
undo
undoes
the last executed command.
unlink
removes
the anchor tag from a selected anchor link.
usecss
toggles
the use of html tags or css for the generated markup. requires a boolean
true/false as a value argument. note: this argument is logically backwards (i.e.
use false to use css, true to use html). (not supported by internet explorer.)
this has been deprecated; use the stylewithcss command instead.
stylewithcss
replaces
the usecss command; argument works as expected, i.e.
true modifies/generates style attributes in markup, false generates
formatting elements.