最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

execCommand Method

Internet Development Index

Executes a command on the current document, current selection, or the given range.

Syntax

bSuccess = object.execCommand(sCommand [, bUserInterface] [, vValue])

Parameters

sCommand Required. String爐hat specifies the command to execute. This command can be any of the command identifiers that can be executed in script.
bUserInterface Optional. Boolean爐hat specifies one of the following values.
falseDefault. Does not display a user interface.
trueDisplays a user interface, if the command supports one.
vValue Optional. Variant that specifies the string, number, or other value to assign. Possible values depend on sCommand .

Return Value

Returns True if the command is successful.

Remarks

Do not invoke the execCommand method until after the page loads.

The bUserInterface and vValue parameters might be required depending on the command being executed.

Example

The following example shows how to use the CreateLink constant as the sCommand of the execCommand method to allow the user to create a hyperlink from selected text. The scriptMicrosoft® JScript® then retrieves the specified URL and uses it to replace the selected text.

<HTML>
<BODY>
<H1 unselectable="on">Creating a Link and Retrieving the URL</H1>
<script>
function AddLink()
{//Identify selected text
var sText = document.selection.createRange();
if (!sText==""){
//Create link
document.execCommand("CreateLink");
//Replace text with URL
if (sText.parentElement().tagName == "A"){
sText.parentElement().innerText=sText.parentElement().href;
document.execCommand("ForeColor","false","#FF0033");
}
}
else{
alert("Please select some blue text!");
}
}
</script>
<P unselectable="on">Select any portion of the following blue text, such as "My favorite Web site". Click the button to turn the selected text into a link. The text will be changed to the URL that you specify.</P>
<P style="color=#3366CC">My favorite Web site is worth clicking on. Don't forget to check out my favorite music group!</P>
<BUTTON onclick="AddLink()" unselectable="on">Click to add link</BUTTON>
</BODY>
</HTML>
This feature requires Microsoft® Internet Explorer 4.0 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

Standards Information

There is no public standard that applies to this method.

Applies To

document, controlRange, TextRange

See Also

queryCommandEnabled, queryCommandIndeterm, queryCommandState, queryCommandSupported, queryCommandValue
盐池县| 佛坪县| 儋州市| 德安县| 望谟县| 新巴尔虎右旗| 沁阳市| 连平县| 乐山市| 盘山县| 松江区| 南宁市| 昌吉市| 土默特左旗| 眉山市| 南乐县| 德安县| 肇州县| 环江| 庆安县| 岳阳县| 冕宁县| 沙田区| 阳高县| 鄂伦春自治旗| 邢台市| 镶黄旗| 密山市| 昌宁县| 怀宁县| 靖宇县| 香港| 石家庄市| 乌海市| 广平县| 昌邑市| 卓尼县| 灌阳县| 抚州市| 勐海县| 孟州市|