Reprint: Document.execcommand () of the use of small notes

Source: Internet
Author: User

The first thing to explain is that under Firefox support is not good.
2d-position allows an absolutely positioned object to be moved by dragging.
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.
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.
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 Redo.
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 stops.
Stopimage is not currently supported.
Strikethrough is not currently supported.
Subscript is not currently supported.
Superscript is not currently supported.
Unbookmark removes all bookmarks from the current selection.
Underline toggles whether the underline of the current selection is displayed or not.
Undo undone.
Unlink removes all hyperlinks from the currently selected area.
Unselect clears the selected state of the current selection.

Example 1:
isNaN is whether the test is numeric, limit input to only numeric values such as: 1981.121, allow up to one decimal point

<input type= "text" name= "text" onkeyup= "if (IsNaN (value)) ExecCommand (' Undo ')"/>


Example 2:

<input Type=button value= cut Onclick=document.execcommand (' cut ') >
<input Type=button value= copy onclick=document.execcommand (' Copy ') >
<input Type=button value= paste onclick=document.execcommand (' Paste ') >
<input Type=button value= undo Onclick=document.execcommand (' Undo ') >
<input Type=button value= Redo Onclick=document.execcommand (' Redo ') Id=button2 name=button2>
<input>
<input Type=button value= Delete onclick=document.execcommand (' delete ') >
<input Type=button value= blackbody onclick=document.execcommand (' bold ') >
<input Type=button value= Italic onclick=document.execcommand (' Italic ') >
<input Type=button value= underline onclick=document.execcommand (' underline ') >
<input Type=button value= Stop Onclick=document.execcommand (' Stop ') >
<input Type=button value= Save Onclick=document.execcommand (' SaveAs ') >
<input Type=button value= Save As Onclick=document.execcommand (' Saveas ', false, ' c:\\test.htm ') >
<input Type=button value= Font onclick=document.execcommand (' FontName ', FALSE,FN) >
<input Type=button value= Font size onclick=document.execcommand (' FontSize ', false,fs) >
<input Type=button value= Refresh Onclick=document.execcommand (' Refresh ', false,0) >

Reprint: Document.execcommand () of the use of small notes

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.