<BODY>
<script>
function AddLink()
{//Identify selected text
var sText = document.selection.createRange();
alert(sText);
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>
<BODY>
<script>
function AddLink()
{//Identify selected text
var sText = document.selection.createRange();
alert(sText);
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>