JavaScript String anchor() 方法

定義和用法

String anchor() 在 JavaScript 中已被棄用。

請避免使用它。

它可能隨時停止在您的瀏覽器中運行。

anchor() 方法返回嵌入在 <a> 標記中的字符串:

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

實例

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

親自試一試

語法

string.anchor("name")

參數

參數 描述
name 必需。錨點的名稱。

返回值

<a> 標簽中嵌入的字符串。