String.link()
<HTML> <BODY> <H1> <SCRIPT> linkText = "Java2s"; document.write(linkText.link("http://www.java2s.com")); </SCRIPT> </H1> </BODY> </HTML>