<html> <head> <title>Text to Hyperlink</title> </head> <body> <h1>Create a link</h1> Select some text and click the button. The selected text will become the named hyperlink<br> My Homepage<br> My Favorite<br> My Search Page<br><br> <button οnclick="createLink(event)">Make it a link</button> <mce:script type="text/javascript"><!-- function createLink(e){//b.b. Troy III p.a.e. if(e.target){ //get ATL var a = window.getSelection().getRangeAt(0); var b = a.toString(); var z = document.createElement("span"); var l2 = prompt("Enter URL:", "http://"); b = b.link(l2); z.innerHTML=b; a.deleteContents(); a.insertNode(z) } else{ //get the ATW document.execCommand("CreateLink") } } // --></mce:script> </body> </html>