HTMLAnchorElement : HTMLElement

Anchor or hyperlink in an HTML document.

Browser/User Agent Support

IEMozillaNetscapeOperaSafariNetscapte
3.0+1.0+2.0+7.0+1.0+no

Constructors

ConstructorIEMozillaNetscapeOperaSafariNetscapte
Anchor or hyperlink in an HTML document.
3.0+1.0+2.0+7.0+1.0+no
 

Properties

PropertyIEMozillaNetscapeOperaSafariNetscapte
Hot-key shortcut for the element.
4.0+nonononono
 
Specifies the character set associated with the element.
6.0+1.0+6.0+7.0+1.0+no
 
Comma-delimited x, y coordinates for the element.
6.0+1.0+6.0+7.0+1.0+no
 
For a databound element, specifies the field supplying the data.
4.0+nonononono
 
Specifies whether or not the element is disabled.
4.0+1.0+4.0+7.0+1.0+no
 
Substring for the URL after the hash (#), if there is one.
3.0+1.0+2.0+7.0+1.0+no
 
Domain name and port substring for the URL.
3.0+1.0+2.0+7.0+1.0+no
 
Domain name portion of the URL.
3.0+1.0+2.0+7.0+1.0+no
 
Path or URL for the linked document or object.
3.0+1.0+2.0+7.0+1.0+no
 
Language code for the linked document or object.
6.0+1.0+6.0+7.0+1.0+no
 
Media type associated with the element.
4.0+nonononono
 
Unique name identifier for the element.
3.0+1.0+2.0+7.0+1.0+no
 
Substring for the URL that contains the file name.
4.0+nonononono
 
Path and filename for the URL.
3.0+1.0+2.0+7.0+1.0+no
 
Substring for the URL that contains the port name.
3.0+1.0+2.0+7.0+1.0+no
 
Substring for the URL that contains the protocol.
3.0+1.0+2.0+7.0+1.0+no
 
Full name for the protocol for the URL.
4.0+nonononono
 
Defines the relationship of the linked document to the current document.
4.0+1.0+6.0+7.0+1.0+no
 
Defines the relationship of the current document to the linked document.
4.0+1.0+6.0+7.0+1.0+no
 
Substring for the URL that contains the query term (after the question mark).
3.0+1.0+2.0+7.0+1.0+no
 
Shape of the object.
6.0+1.0+6.0+7.0+1.0+no
 
Position of the element in the tabbing order for the document.
4.0+1.0+6.0+7.0+1.0+no
 
Target window to use for opening the linked document.
3.0+1.0+2.0+7.0+1.0+no
 
Text enclosed by the open and close "a" tags.
nono4.0+nonono
 
Specifies the MIME type for the target document or object.
6.0+1.0+6.0+7.0+1.0+no
 
URN for the target document or object.
4.0+nonononono
 
Horizontal (x) position of the element relative to the left edge of the document.
nono4.0+nonono
 
Vertical (y) position of the element relative to the top edge of the document.
nono4.0+nonono
 

Methods

MethodIEMozillaNetscapeOperaSafariNetscapte
Takes focus off of the element.
3.0+1.0+2.0+7.0+1.0+no
 
Gives the element focus.
3.0+1.0+2.0+7.0+1.0+no
 
Process the instance of the event.
nono4.0+nonono
 

References

Link | Anchor

Availability

HTML DOM Level 1 | HTML DOM Level 2 | W3C

Constructor Detail

HTMLAnchorElement HTMLAnchorElement()

Anchor or hyperlink in an HTML document.

Visibility
internal

Property Detail

String accessKey

Hot-key shortcut for the element.

Availability

HTML DOM Level 1 | HTML DOM Level 2 | W3C

String charset

Specifies the character set associated with the element.

Availability

HTML DOM Level 1 | HTML DOM Level 2 | W3C

String coords

Comma-delimited x, y coordinates for the element.

Availability

HTML DOM Level 1 | HTML DOM Level 2 | W3C

String dataFld

For a databound element, specifies the field supplying the data.

Boolean disabled

Specifies whether or not the element is disabled.

For examples, see the quirksmode test page:

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

String hash

Substring for the URL after the hash (#), if there is one.

String host

Domain name and port substring for the URL.

String hostname

Domain name portion of the URL.

String href

Path or URL for the linked document or object.

Availability

HTML DOM Level 1 | HTML DOM Level 2 | W3C

String hreflang

Language code for the linked document or object.

Availability

HTML DOM Level 1 | HTML DOM Level 2 | W3C

String media

Media type associated with the element.

Availability

HTML DOM Level 1

String name

Unique name identifier for the element.

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

String nameProp - read only

Substring for the URL that contains the file name.

Availability

HTML DOM Level 1

String pathname

Path and filename for the URL.

String port

Substring for the URL that contains the port name.

String protocol

Substring for the URL that contains the protocol.

String protocolLong

Full name for the protocol for the URL.

String rel

Defines the relationship of the linked document to the current document.

Availability

HTML DOM Level 1 | HTML DOM Level 2 | W3C

String rev

Defines the relationship of the current document to the linked document.

Availability

HTML DOM Level 1 | HTML DOM Level 2 | W3C

String search

Substring for the URL that contains the query term (after the question mark).

String shape

Shape of the object.

Availability

HTML DOM Level 1 | HTML DOM Level 2 | W3C

Number tabIndex

Position of the element in the tabbing order for the document.

Availability

HTML DOM Level 1 | HTML DOM Level 2 | W3C

String target

Target window to use for opening the linked document.

Availability

HTML DOM Level 1 | HTML DOM Level 2 | W3C

String text

Text enclosed by the open and close "a" tags.

Remarks
Instead of the text property, use DOM methods to access the text, if possible.

String type

Specifies the MIME type for the target document or object.

Availability

HTML DOM Level 1 | HTML DOM Level 2 | W3C

String urn

URN for the target document or object.

String x - read only

Horizontal (x) position of the element relative to the left edge of the document.

String y

Vertical (y) position of the element relative to the top edge of the document.

Method Detail

blur() : void

Takes focus off of the element.

Availability

HTML DOM Level 1 | HTML DOM Level 2 | W3C

focus() : void

Gives the element focus.

Availability

HTML DOM Level 1 | HTML DOM Level 2 | W3C

handleEvent(Event event) : void

Process the instance of the event.

EventeventType of event.