JavaScript中的anchor()方法使用详解
此方法创建一个用作超文本目标的HTML锚。
语法
string.anchor(anchorname)
下面是参数的详细信息:
- anchorname:定义了锚的名称
返回值:
- 返回其锚标记的字符串
例子:
<html>
<head>
<title>JavaScriptStringanchor()Method</title>
</head>
<body>
<scripttype="text/javascript">
varstr=newString("Helloworld");
alert(str.anchor("myanchor"));
</script>
</body>
</html>
这将产生以下结果:
<aname="myanchor">Helloworld</a>
热门推荐
1 圆圆的祝福语简短
10 离别简短的祝福语大全
11 职场离职文案祝福语简短
12 宝宝周岁敬酒祝福语简短
13 周年庆典祝福语致辞简短
14 简短的出行工作祝福语
15 开店大吉文案祝福语简短
16 祖国七十华诞简短祝福语
17 车行销售祝福语简短
18 夸赞老师祝福语搞笑简短