当前位置: 首页 > 网络学院 > 客户端脚本教程 > JavaScript > JavaScript anchor()方法

JavaScript
JS 介绍
JS 怎样使用
JS 在哪使用
JS 变量
JS If...Else
JS Switch
JS 操作符
JS Popup Boxes
JS 函数
JS For 循环
JS While 循环
JS Break 循环
JS For...In
JS 事件
JS Try...Catch
JS Throw
JS onerror
JS 特殊字符
JS Guidelines
JS 对象介绍

JavaScript anchor()方法


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 823 ::
收藏到网摘: n/a

Definition and Usage
定义与用法

The anchor() method is used to create an HTML anchor.
anchor()方法可用来建立HTML锚记。

Syntax
语法

stringObject.anchor(anchorname)

Parameter
参数
Description
描述
anchorname Required. Defines a name for the anchor
必选。定义锚记的名称


Example
举例

In this example we will add an anchor to a text:
在这个举例中我们将给一段文字加上锚记:

<script type="text/javascript">
var txt="Hello world!"
document.write(txt.anchor("myanchor"))
</script>

The code above could be written in plain HTML, like this:
代码输出的结果会解释成为类似这样的HTML:

<a name="myanchor">Hello world!</a>


Try-It-Yourself Demos
尝试与演示

anchor()
How to use anchor() create an HTML anchor.
如何使用anchor()来建立一个HTML锚记

评论 (0) All

登陆 | 还没注册?