DOM Anchor

Anchor Object
锚对象

The Anchor object represents an HTML hyperlink. For each instance of an HTML <a> tag in a document, an Anchor object is created.
锚对象代表一个HTML超级链接。HTML文档中有<a>标签,一个锚对象就随之建立了

An anchor can be used to create a link to another document (with the href attribute) or to create a bookmark inside a document (with the name attribute).
锚对象可以被用来建立一条到另一文档的连接(通过href属性)或在文档内建立一个书签(用name属性)

You can access an Anchor object by indexing the anchors' array (by number or name) of the Document object or by using getElementById().
你可以通过Document对象或使用getElementById()索引锚的数组(用name的数字)来访问一个锚对象

IE: Internet Explorer, F: Firefox火狐, N: Netscape网景, W3C: World Wide Web Consortium (Internet Standard).

Anchor 对象属性

Property属性Description描述IEFOW3C
accessKeySets or returns a keyboard key to access a link
设置或返回可访问链接的按键
51NoYes
charsetSets or returns the character-set of the linked resource
设置或返回所链接资源的字符集
619Yes
coordsSets or returns a comma-separated list with coordinates of a link in an image-map
设置或返回用逗号分割的列表里面有热点图链接
619Yes
hrefSets or returns the URL of the linked resource
设置或返回所链资源的URL
519Yes
hreflangSets or returns the language code of the linked resource
设置或返回所链资源的语言代码
619Yes
idSets or returns the id of a link
设置或返回链接的id
419Yes
innerHTMLSets or returns the text of a link
设置或返回链接的文字
419No
nameSets or returns the name of a link
设置或返回链接的name
419Yes
relSets or returns the relationship between the current document and the target URL
设置或返回当前文当个目标URL之间的关联
51NoYes
revSets or returns the relationship between the target URL and the current document
设置或返回目标URL和当前文档之间的关联
51NoYes
shapeSets or returns the shape of a link in an image-map
设置或返回在热点图中链接的形状
619Yes
tabIndexSets or returns the tab order for a link
设置或返回链接的tab顺序
619Yes
targetSets or returns where to open a link
设置或返回打开链接的方式
519Yes
typeSets or returns the MIME type of the linked resource
设置或返回所链资源的MIME类型
619Yes

Standard Properties
标准属性

Property
属性
Description
描述
IE FOW3C
classNameSets or returns the class attribute of an element
设置或返回元素的class属性
519Yes
dirSets or returns the direction of text
设置或返回文字的方向
519Yes
langSets or returns the language code for an element
设置或返回某一元素的语言代码
519Yes
titleSets or returns an element's advisory title
设置或返回某元素的咨询标题
519Yes

Anchor Object Methods
锚对象方法

Method
方法
Description
描述
IEFOW3C
blur()Removes focus from the link
取消对某连接的聚焦
519Yes
focus()Gives focus to the link
让某连接获得聚焦
519Yes
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值