An expression that returns one of the objects in the Applies To list. The value parameter must specify the color name of the background color. The following code sets the background color for the selection to yellow. Copy Copies the current selection to the Clipboard. The following code copies the selection to the Clipboard. The following code creates a bookmark anchor named "newbookmark" around the selected text.

Author:Mikarr Tek
Language:English (Spanish)
Published (Last):11 September 2005
PDF File Size:7.28 Mb
ePub File Size:15.64 Mb
Price:Free* [*Free Regsitration Required]

See also Obsolete This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it. When an HTML document has been switched to designMode , its document object exposes an execCommand method to run commands that manipulate the current editable region, such as form inputs or contentEditable elements. When using contentEditable, execCommand affects the currently active editable element. Syntax Return value A Boolean that is false if the command is unsupported or disabled.

Note: Only returns true if part of a user interaction. See Commands for a list of possible commands. This is not implemented in Mozilla. For example, insertImage requires the URL of the image to insert. Specify null if no argument is needed. Commands backColor Changes the document background color. In styleWithCss mode, it affects the background color of the containing block instead.

Note that Internet Explorer uses this to set the text background color. ClearAuthenticationCache Clears all authentication credentials from the cache. Not supported by Internet Explorer. Conditions of having this behavior enabled vary from one browser to another, and have evolved over time.

Check the compatibility table to determine if you can use it in your case. The URI must contain at least a single character, which may be whitespace. Internet Explorer will create a link with a null value. When this behavior is enabled varies between browsers, and its conditions have evolved over time. Check the compatibility table for usage details. See Differences in markup generation for more details. This requires a font name string like "Arial" as a value argument. This requires an integer from as a value argument.

This requires a hexadecimal color value string as a value argument. Requires a tag-name string as a value argument. Virtually all block-level elements can be used.

Requires the tag-name string as a value argument i. Not supported by Internet Explorer and Safari. Requires a color value string as a value argument. In Firefox, if the selection spans multiple lines at different levels of indentation, only the least indented lines in the selection will be indented.

Requires a valid HTML string as a value argument. The requirements for this string are the same as createLink. Internet Explorer inserts a paragraph at the insertion point and deletes the selection. Disabled for web content. See [1]. NOTE: This argument is logically backwards i. This has been deprecated in favor of styleWithCSS. Example An example of how to use it on CodePen.


execCommand Method





Related Articles