JavaScript String anchor()

❮ JavaScript String Reference

Example

let text = "Hello World!";
let result = text.anchor("Chapter 10");
Try it Yourself »

Description

String anchor() is deprecated in JavaScript.

Avoid using it.

It may cease to work in your browser at any time.

The anchor method returns a string embedded in an <a> tag:

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


Syntax

string.anchor("name")

Parameters

Parameter Description
name Required.
The name of the anchor.

Return Value

A string embedded in an <a> tag.

❮ JavaScript String Reference
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.