The execcommand in JavaScript

Source: Internet
Author: User

The ExecCommand method is to execute a command against the current document, the current selection, or the given range. Commonly used when working with HTML data

Format: Document.execcommand (scommand[, interactive mode, dynamic parameter]), where: Scommand is the instruction parameter ("2d-position" in the following example), the interactive mode parameter if True, the dialog box is displayed, If False, the dialog box is not displayed ("false" in the following example means that the dialog box is not displayed), and the dynamic parameter is generally an available value or a property value ("True" in the following example).

Document.execcommand ("2d-position", "false", "true");

The following is a list of directive parameters and meanings

2d-position allows an absolutely positioned object to be moved by dragging. Www.mlyrx120.com

AbsolutePosition the Position property of the Set element is "absolute" (absolute).

BackColor Sets or gets the background color of the currently selected area.

BLOCKDIRLTR is not currently supported.

BLOCKDIRRTL is not currently supported.

Bold toggles whether the current selection is displayed in bold or not.

Browsemode is not currently supported.

Copy copies the currently selected area to the Clipboard.

CreateBookMark creates a bookmark anchor or gets the name of the bookmark anchor for the current selection or insertion point.

Createlink inserts a hyperlink on the current selection, or displays a dialog box that allows the user to specify the URL of the hyperlink to be inserted for the current selection.

Cut copies the currently selected area to the Clipboard and deletes it.

Delete Deletes the currently selected area.

DIRLTR is not currently supported.

DIRRTL is not currently supported.

EditMode is not currently supported.

FontName Sets or gets the font for the currently selected area.

FontSize Sets or gets the font size for the current selection.

ForeColor Sets or gets the foreground (text) color of the currently selected area.

Formatblock sets the current block formatting label.

Indent increases the indentation of the selected text.

INLINEDIRLTR is not currently supported.

INLINEDIRRTL is not currently supported.

Insertbutton overrides the current selection with a button control.

InsertFieldSet overwrites the current selection with a box.

Inserthorizontalrule overwrites the current selection with a horizontal line.

Insertiframe overwrites the current selection with an inline frame.

Insertimage overwrites the current selection with an image.

Insertinputbutton overrides the current selection with a button control.

Insertinputcheckbox overwrites the current selection with a check box control.

Insertinputfileupload overwrites the current selection with a file upload control.

Insertinputhidden inserts a hidden control that overrides the current selection.

Insertinputimage overwrites the current selection with an image control. Rl.82676666.com

Insertinputpassword overwrites the current selection with a password control.

Insertinputradio overwrites the current selection with the radio button control.

Insertinputreset overrides the current selection with a reset control.

Insertinputsubmit overwrites the current selection with a Submit control.

Insertinputtext overwrites the current selection with a text control.

Insertmarquee overwrites the current selection with an empty caption.

Insertorderedlist Toggles whether the current selection is a numbered list or a regular formatting block.

InsertParagraph overwrites the currently selected area with a newline.

Insertselectdropdown overwrites the current selection with a drop-down box control.

Insertselectlistbox overwrites the current selection with a ListBox control.

Inserttextarea overwrites the current selection with the multiline text input control.

Insertunorderedlist Toggles whether the current selection is a bulleted list or a regular formatting block.

Italic Toggle the current selection italic display or not.

Justifycenter the current selection in the formatted block.

Justifyfull is not currently supported.

Justifyleft aligns the formatting blocks in the current selection to the left.

Justifynone is not currently supported.

Justifyright Right aligns the formatting blocks in the current selection.

Liveresize forces the MSHTML editor to continuously update the appearance of elements while zooming or moving, rather than just updating after the move or zoom is complete.

Multipleselection allows more than one site-selectable element to be selected at a time when the user holds down the shift or Ctrl key.

Open is not currently supported.

Outdent reduces the indentation of the formatting block where the selection is located.

OverWrite toggles the insertion and overwriting of text states.

Paste overwrites the current selection with the Clipboard contents.

Playimage is not currently supported.

Print opens the Printing dialog box so that the user can print the current page.

Redo is not currently supported.

Refresh refreshes the current document.

Removeformat removes the formatted label from the current selection.

Removeparaformat is not currently supported.

SaveAs saves the current Web page as a file.

SelectAll Select the entire document.

SizeToControl is not currently supported.

SizeToControlHeight is not currently supported.

SizeToControlWidth is not currently supported.

Stop is not currently supported.

Stopimage is not currently supported.

Strikethrough is not currently supported.

Subscript is not currently supported.

Superscript is not currently supported. M.120hrb.com

Unbookmark removes all bookmarks from the current selection.

Underline toggles whether the underline of the current selection is displayed or not.

Undo is not currently supported.

Unlink removes all hyperlinks from the currently selected area.

Unselect clears the selected state of the current selection.

The execcommand in JavaScript

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.