Execommand to create hyperlink
来源:互联网 发布:南方数据传输软件 编辑:程序博客网 时间:2024/05/20 02:30
<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>
- Execommand to create hyperlink
- Hyperlink
- HYPERLINK
- HyperLink
- Adding Hyperlink Capability to RichText Boxes
- Creating back to top asp.net hyperlink
- How to Render the Hyperlink with Braces
- 执行命令行的函数 ExeCommand
- How to create singleton
- How to create alarm
- How to create WCF
- To create tablespaces
- Unable to Create Process
- Mulberry tasker to create
- failed to create process
- How to Create Tables
- How to Create a Customer
- How to create Firefox extensions
- javascript小技巧
- ASP中使用事务处理
- 可以弹出小文本框作为注释的TextPopup
- Struts+Spring+Hibernate 的示例(一)
- 天气愚报之麦莎老狼来了
- Execommand to create hyperlink
- 男人很难取悦!!
- 使用JNDI的一个容易忽略的错误
- 了解SQL2005中的SMO对象使用(-)
- 在C#中如何用字符串来替代对象的名称
- 我该说什么
- 夜夜狂欢的派对
- Java 繁体中文处理完全攻略 -- 简体中文参照操作即可