JavaScript String anchor() methode

Definitie en gebruik

De String anchor() methode in JavaScript is verouderd.

Gebruik het liever niet.

Het kan op elk moment stoppen met draaien in uw browser.

anchor() The method returns the string embedded in the <a> tag:

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

Example

let text = "Hello World!";
let result = text.anchor("Chapter 10");

Try it yourself

Syntax

string.anchor("name)

Parameters

Parameters Description
name Required. The name of the anchor.

Return value

String embedded in the <a> tag.