The anchor() method creates an HTML anchor. This method returns the string embedded in the <a> tag, like this:
The anchor() method creates an HTML anchor. This method returns the string embedded in the <a> tag, like this:
<a name="anchorname">string</a>
string.anchor("name")
Parameter | Require | Description |
---|---|---|
name | Required. | The name of the anchor |
A string embedded in the <a> tag
Create an HTML anchor around a string:
var txt = "test"; console.log(txt.anchor("link"));