定义和用法:
anchor() 方法用于创建 HTML 锚。
该方法返回加了 <a> 标签
的字符串, 如下所示:
<a name="anchorname">string</a>
语法:
string.anchor(name)
参数 : 描述:
name Required. The name of the anchor
浏览器支持:
代码演示如下:
<!DOCTYPE html><html><head><meta charset="utf-8"></head><body><script>var txt="Chapter 10";txt.anchor("chap10");alert(txt.anchor("chap10"));</script></body></html>
运行结果如下:
推荐学习:《PHP视频教程》