HTMLAnchorElement : HTMLElement
Return to: HTML DOM Level 2 index

Anchor or hyperlink in an HTML document.

Platform Support

IE Mozilla Netscape Opera Safari Chrome
3.0+ 1.0+ 2.0+ 7.0+ 1.0+ no

Constructors

Constructor Action IE Mozilla Netscape Opera Safari Chrome
HTMLAnchorElement Constructor() : HTMLAnchorElement
Anchor or hyperlink in an HTML document.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+ no

HTMLAnchorElement() : HTMLAnchorElement

Anchor or hyperlink in an HTML document.

Returns
HTMLAnchorElement

Visibility
internal

Properties

Property Action IE Mozilla Netscape Opera Safari Chrome
accessKey : String
Hot-key shortcut for the element.
Show Details 4.0+ no no no no no
Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

charset : String
Specifies the character set associated with the element.
Show Details 6.0+ 1.0+ 6.0+ 7.0+ 1.0+ no
Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

coords : String
Comma-delimited x, y coordinates for the element.
Show Details 6.0+ 1.0+ 6.0+ 7.0+ 1.0+ no
Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

dataFld : String
For a databound element, specifies the field supplying the data.
No Details 4.0+ no no no no no
disabled : Boolean
Specifies whether or not the element is disabled.
Show Details 4.0+ 1.0+ 4.0+ 7.0+ 1.0+ no

For examples, see the quirksmode test page:

http://www.quirksmode.org/dom/tests/stylesheets.html

hash : String
Substring for the URL after the hash (#), if there is one.
No Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+ no
host : String
Domain name and port substring for the URL.
No Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+ no
hostname : String
Domain name portion of the URL.
No Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+ no
href : String
Path or URL for the linked document or object.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+ no
Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

hreflang : String
Language code for the linked document or object.
Show Details 6.0+ 1.0+ 6.0+ 7.0+ 1.0+ no
Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

media : String
Media type associated with the element.
Show Details 4.0+ no no no no no
Availability

HTML DOM Level 1

name : String
Unique name identifier for the element.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+ no

For examples, see the quirksmode test page:

http://www.quirksmode.org/dom/tests/attributes.html

Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

nameProp : String
Substring for the URL that contains the file name.
Show Details 4.0+ no no no no no
Availability

HTML DOM Level 1

pathname : String
Path and filename for the URL.
No Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+ no
port : String
Substring for the URL that contains the port name.
No Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+ no
protocol : String
Substring for the URL that contains the protocol.
No Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+ no
protocolLong : String
Full name for the protocol for the URL.
No Details 4.0+ no no no no no
rel : String
Defines the relationship of the linked document to the current document.
Show Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+ no
Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

rev : String
Defines the relationship of the current document to the linked document.
Show Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+ no
Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

search : String
Substring for the URL that contains the query term (after the question mark).
No Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+ no
shape : String
Shape of the object.
Show Details 6.0+ 1.0+ 6.0+ 7.0+ 1.0+ no
Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

tabIndex : Number
Position of the element in the tabbing order for the document.
Show Details 4.0+ 1.0+ 6.0+ 7.0+ 1.0+ no
Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

target : String
Target window to use for opening the linked document.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+ no
Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

text : String
Text enclosed by the open and close "a" tags.
Show Details no no 4.0+ no no no
Remarks
Instead of the text property, use DOM methods to access the text, if possible.
type : String
Specifies the MIME type for the target document or object.
Show Details 6.0+ 1.0+ 6.0+ 7.0+ 1.0+ no
Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

urn : String
URN for the target document or object.
No Details 4.0+ no no no no no
x : String
Horizontal (x) position of the element relative to the left edge of the document.
No Details no no 4.0+ no no no
y : String
Vertical (y) position of the element relative to the top edge of the document.
No Details no no 4.0+ no no no

Functions

Method Action IE Mozilla Netscape Opera Safari Chrome
blur() : void
Takes focus off of the element.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+ no

Returns
void

Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

focus() : void
Gives the element focus.
Show Details 3.0+ 1.0+ 2.0+ 7.0+ 1.0+ no

Returns
void

Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

handleEvent(Event event) : void
Process the instance of the event.
Show Details no no 4.0+ no no no

Parameters
Event event Type of event.

Returns
void

References

Link|Anchor

Availability

HTML DOM Level 1|HTML DOM Level 2|W3C

text_javascript aptana_docs