ÍøÂçѧԺ w3popÉçÇø ÍøÂç×ÊÔ´ ITÐÂÎÅ

w3pop.com :: ÍøÂçѧԺ :: HTML DOM :: DOM Anchor

»áÔ±µÇ½

ÕʺÅ

ÃÜÂë

»Ø´ð

¼ÇסÃÜÂë

Íü¼ÇÃÜÂë? ×¢²á

HTML DOM
DOM ½éÉÜ
HTML DOM ¾ÙÀý
DOM ²Î¿¼
DOM ÕªÒª
HTML DOM ʵÀý
DOM Anchor
DOM Applet
DOM Area
DOM Base ¶ÔÏó
DOM Basefont¶ÔÏó
DOM Body ¶ÔÏó
DOM Document ¶ÔÏ..
DOM ʼþ
DOM Form ¶ÔÏó
DOM Frame ¶ÔÏó
DOM Frameset ¶ÔÏ..
DOM History
DOM Iframe ¶ÔÏó
DOM Image ¶ÔÏó
HTML DOM Button¶..

DOM Anchor


×÷Õß:w3pop.com ·­Òë/ÕûÀí:w3pop.com ·¢²¼:2007-04-28 ä¯ÀÀ:9458 :: ::

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ÃèÊö IE F O W3C
accessKey Sets or returns a keyboard key to access a link
ÉèÖûò·µ»Ø¿É·ÃÎÊÁ´½ÓµÄ°´¼ü
5 1 No Yes
charset Sets or returns the character-set of the linked resource
ÉèÖûò·µ»ØËùÁ´½Ó×ÊÔ´µÄ×Ö·û¼¯
6 1 9 Yes
coords Sets or returns a comma-separated list with coordinates of a link in an image-map
ÉèÖûò·µ»ØÓöººÅ·Ö¸îµÄÁбíÀïÃæÓÐÈȵãͼÁ´½Ó
6 1 9 Yes
href Sets or returns the URL of the linked resource
ÉèÖûò·µ»ØËùÁ´×ÊÔ´µÄURL
5 1 9 Yes
hreflang Sets or returns the language code of the linked resource
ÉèÖûò·µ»ØËùÁ´×ÊÔ´µÄÓïÑÔ´úÂë
6 1 9 Yes
id Sets or returns the id of a link
ÉèÖûò·µ»ØÁ´½ÓµÄid
4 1 9 Yes
innerHTML Sets or returns the text of a link
ÉèÖûò·µ»ØÁ´½ÓµÄÎÄ×Ö
4 1 9 No
name Sets or returns the name of a link
ÉèÖûò·µ»ØÁ´½ÓµÄname
4 1 9 Yes
rel Sets or returns the relationship between the current document and the target URL
ÉèÖûò·µ»Øµ±Ç°Îĵ±¸öÄ¿±êURLÖ®¼äµÄ¹ØÁª
5 1 No Yes
rev Sets or returns the relationship between the target URL and the current document
ÉèÖûò·µ»ØÄ¿±êURLºÍµ±Ç°ÎĵµÖ®¼äµÄ¹ØÁª
5 1 No Yes
shape Sets or returns the shape of a link in an image-map
ÉèÖûò·µ»ØÔÚÈȵãͼÖÐÁ´½ÓµÄÐÎ×´
6 1 9 Yes
tabIndex Sets or returns the tab order for a link
ÉèÖûò·µ»ØÁ´½ÓµÄtab˳Ðò
6 1 9 Yes
target Sets or returns where to open a link
ÉèÖûò·µ»Ø´ò¿ªÁ´½ÓµÄ·½Ê½
5 1 9 Yes
type Sets or returns the MIME type of the linked resource
ÉèÖûò·µ»ØËùÁ´×ÊÔ´µÄMIMEÀàÐÍ
6 1 9 Yes

Standard Properties
±ê×¼ÊôÐÔ

Property
ÊôÐÔ
Description
ÃèÊö
IE  F O W3C
className Sets or returns the class attribute of an element
ÉèÖûò·µ»ØÔªËصÄclassÊôÐÔ
5 1 9 Yes
dir Sets or returns the direction of text
ÉèÖûò·µ»ØÎÄ×ֵķ½Ïò
5 1 9 Yes
lang Sets or returns the language code for an element
ÉèÖûò·µ»ØÄ³Ò»ÔªËصÄÓïÑÔ´úÂë
5 1 9 Yes
title Sets or returns an element's advisory title
ÉèÖûò·µ»ØÄ³ÔªËصÄ×Éѯ±êÌâ
5 1 9 Yes

Anchor Object Methods
ê¶ÔÏó·½·¨

Method
·½·¨
Description
ÃèÊö
IE F O W3C
blur() Removes focus from the link
È¡Ïû¶ÔijÁ¬½ÓµÄ¾Û½¹
5 1 9 Yes
focus() Gives focus to the link
ÈÃijÁ¬½Ó»ñµÃ¾Û½¹
5 1 9 Yes

ÆÀÂÛ (0) All