JavaScript Objects: Strings - The Anchor() Method
(Page 4 of 6 )
The Anchor method creates an HTML anchor. Here is the code:
<html>
<body>
<script type="text/javascript">
var sometext="Here is some text!"
document.write(sometext.anchor("myanchor"))
</script>
</body>
</html>
The result of this code would be: Here is some text!
In HTML, the equivalent code would be:
<a name="myanchor">Hello world!</a>
Next: The Big() Method >>
More JavaScript Articles
More By James Payne