Definition and Usage The anchor() method is used to create an HTML anchor. Syntax stringObject.anchor(anchorname) Parameter ...
Definition and Usage
The anchor() method is used to create an HTML anchor.
Syntax
stringObject.anchor(anchorname) |
Parameter | Description |
anchorname | Required. Defines a name for the anchor |
Example
In this example we will add an anchor to a text:
<script type="text/javascript"> var txt="Hello world!";
document.write(txt.anchor("myanchor")); </script> |
The code above could be written in plain HTML, like this:
<a name="myanchor">Hello world!</a> |