2.execCommand()基本命令
(1)2D-Position 允许通过拖曳移动绝对定位的对象。
Command |
2D-Position |
User interface |
None. Set bUserinterface to false. |
execCommand vValue |
Required. Boolean specifying whether this feature is to be on or off. |
Applies to |
queryCommandValue. |
Minimum Availability:Internet Explorer 5.5 and later.
(2)AbsolutePosition 设定元素的 position 属性为“absolute”(绝对)。
Command |
AbsolutePosition |
User interface |
None. Set bUserinterface to false. |
execCommand vValue |
Required. Boolean specifying whether the element is to be absolutely positioned. |
Applies to |
queryCommandValue. |
Minimum Availability:Internet Explorer 5.5 and later.
(3)BackColor 设置或获取当前选中区的背景颜色。
Command |
BackColor |
User interface |
None. Set bUserinterface to false. |
execCommand vValue |
Required. String that specifies a color name or a six-digit hexadecimal RGB value, with or without a leading hash mark, as defined in the Color Table. |
Applies to |
queryCommandValue. |
Minimum Availability:Internet Explorer 4.0 and later.
BlockDirLTR 目前尚未支持。
BlockDirRTL 目前尚未支持。
Bold 切换当前选中区的粗体显示与否。
Command |
Bold |
User interface |
None. Set bUserinterface to false or omit. |
execCommand vValue |
Optional. Set to null or omit. |
Applies to |
queryCommandValue. |
Minimum Availability:Internet Explorer 4.0 and later.
BrowseMode 目前尚未支持。
ClearAuthenticationCache 清除缓冲区的身份验证。仅用于execCommand.
Command |
ClearAuthenticationCache |
User interface |
None. Set bUserinterface to false or omit. |
execCommand vValue |
Optional. Set to null or omit. |
Applies to |
queryCommandValue. |
Minimum Availability :Internet Explorer 6 SP1 and later.
Copy 将当前选中区复制到剪贴板。
Command |
Copy |
User interface |
None. Set bUserinterface to false or omit. |
execCommand vValue |
Optional. Set to null or omit. |
Applies to |
queryCommandValue. |
Minimum Availability :Internet Explorer 4.0 and later.
CreateBookmark 创建一个书签锚或获取当前选中区或插入点的书签锚的名称。
Command |
CreateBookmark |
User interface |
None. Set bUserinterface to false. |
execCommand vValue |
Required. String that specifies a valid anchor name. Providing an empty string will cause the command to fail. |
Applies to |
queryCommandValue. |
CreateLink 在当前选中区上插入超级链接,或显示一个对话框允许用户指定要为当前选中区插入的超级链接的 URL。
Command |
CreateLink |
User interface |
Optional. This command displays a dialogue box if the bUserinterface argument of execCommand is set to true or omitted. It does not display a dialogue box if the argument is set to false or null and the vValue parameter is present (even if it's null). |
execCommand vValue |
Optional. String that specifies a URL. |
Applies to |
queryCommandValue. |
Cut 将当前选中区复制到剪贴板并删除之。
Command |
Cut |
User interface |
None. Set bUserinterface to false or omit. |
execCommand vValue |
Optional. Set to null or omit. |
Applies to |
queryCommandValue. |
Delete 删除当前选中区。
Command |
Delete |
User interface |
None. Set bUserinterface to false or omit. |
execCommand vValue |
Optional. Set to null or omit. |
Applies to |
queryCommandValue. |
DirLTR 目前尚未支持。
DirRTL 目前尚未支持。
EditMode 目前尚未支持。
FontName 设置或获取当前选中区的字体。
Command |
FontName |
User interface |
None. Set bUserinterface to false. |
execCommand vValue |
Required. String that specifies a font name or font list, as described by the font Attribute. |
Applies to |
queryCommandValue. |
FontSize 设置或获取当前选中区的字体大小。
Command |
FontSize |
User interface |
None. Set bUserinterface to false. |
execCommand vValue |
Required. Integer or String that specifies the font size. This must be a value between 1 and 7, inclusive. |
Applies to |
queryCommandValue. |
ForeColor 设置或获取当前选中区的前景(文本)颜色。
Command |
ForeColor |
User interface |
None. Set bUserinterface to false. |
execCommand vValue |
Required. String that specifies a color name or a six-digit hexadecimal RGB value, with or without a leading hash mark, as defined in the Color Table. |
Applies to |
queryCommandValue. |
FormatBlock 设置当前块格式化标签。
Command |
FormatBlock |
User interface |
None. Set bUserinterface to false. |
execCommand vValue |
Required. String that specifies a valid block format tag. |
Applies to |
queryCommandValue. |
Indent 增加选中文本的缩进。
Command |
Indent |
User interface |
None. Set bUserinterface to false or omit. |
execCommand vValue |
Optional. Set to null or omit. |
Applies to |
queryCommandValue. |
InlineDirLTR 目前尚未支持。
InlineDirRTL 目前尚未支持。
InsertButton 用按钮控件覆盖当前选中区。
Command |
InsertButton |
User interface |
None. Set bUserinterface to false or omit. |
execCommand vValue |
Optional. String that specifies an id Attribute for the button control. |
Applies to |
queryCommandValue. |
InsertFieldset 用方框覆盖当前选中区。
Command |
InsertFieldset |
User interface |
None. Set bUserinterface to false or omit. |
execCommand vValue |
Optional. String that specifies an id Attribute for the box. May be set to null or omitted. |
Applies to |
queryCommandValue. |
InsertHorizontalRule 用水平线覆盖当前选中区。
Command |
InsertHorizontalRule |
User interface |
None. Set bUserinterface to false or omit. |
execCommand vValue |
Optional. String that specifies an id Attribute for the horizontal line. May be set to null or omitted. |
Applies to |
queryCommandValue. |
InsertIFrame 用内嵌框架覆盖当前选中区。
Command |
InsertIFrame |
User interface |
None. Set bUserinterface to false or omit. |
execCommand vValue |
Optional. String that specifies an id Attribute for the inline frame. May be set to null or omitted. |
Applies to |
queryCommandValue. |
InsertImage 用图像覆盖当前选中区。
Command |
InsertImage |
User interface |
Optional. This command displays a dialogue box if the bUserinterface argument of execCommand is set to true or omitted. It does not display a dialogue box if the argument is set to false or null and the vValue parameter is present (even if it's null). |
execCommand vValue |
Optional. String that specifies the path and file name of the image to be inserted. If the command displays a dialogue box, this parameter is ignored. |
Applies to |
queryCommandValue. |
InsertInputButton 用按钮控件覆盖当前选中区。
Command |
InsertInputButton |
User interface |
None. Set bUserinterface to false or omit. |
execCommand vValue |
Optional. String that specifies an id Attribute for the button control. May be set to null or omitted. |
Applies to |
queryCommandValue. |
InsertInputCheckbox 用复选框控件覆盖当前选中区。
Command |
InsertInputCheckbox |
User interface |
None. Set bUserinterface to false or omit. |
execCommand vValue |
Optional. String that specifies an id Attribute for the check box control. May be set to null or omitted. |
Applies to |
queryCommandValue. |
b