Easy Tutorial
❮ Event Button Jsref Regexp Newline ❯

JavaScript anchor() Method


Definition and Usage

The anchor() method is used to create an HTML anchor.

This method returns a string with an <a> tag added, as shown below:

<a name="anchorname">string</a>

Syntax

Parameter Description
name Required. The name of the anchor

Browser Support

All major browsers support the anchor() method.


Example

Create an HTML anchor:

❮ Event Button Jsref Regexp Newline ❯