A hypertext link.
Platform Support
| IE | Mozilla | Netscape | Opera | Chrome | Safari | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 5.0+ | 1.0+ |
|---|
Constructors
| Constructor | Action | IE | Mozilla | Netscape | Opera | Chrome | Safari | ||
|---|---|---|---|---|---|---|---|---|---|
|
Link Constructor() : Link
Creates a new instance of a Link object.
|
Show Details | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 5.0+ | 1.0+ | ||
Link() : LinkCreates a new instance of a Link object. Returns
|
|||||||||
Properties
| Property | Action | IE | Mozilla | Netscape | Opera | Chrome | Safari |
|---|---|---|---|---|---|---|---|
|
onclick
: Function
Event handler for when a user clicks on the link.
|
Show Details | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 5.0+ | 1.0+ |
|
|||||||
|
onmouseout
: Function
Event handler for when a user moves the mouse off of the link.
|
Show Details | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 5.0+ | 1.0+ |
|
|||||||
|
onmouseover
: Function
Event handler for when a user moves the mouse over the link.
|
Show Details | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 5.0+ | 1.0+ |
|
|||||||
|
target
: Object
Window to display the contents of the link.
|
Show Details | 4.0+ | 1.0+ | 6.0+ | 7.0+ | 5.0+ | 1.0+ |
|
|||||||
|
Anchor portion of the URL of the link.
|
No Details | 4.0+ | 1.0+ | 6.0+ | no | no | no |
|
|
|||||||
|
Host name and port of the URL of the link.
|
No Details | 4.0+ | 1.0+ | 6.0+ | no | no | no |
|
|
|||||||
|
Host name of the URL of the link.
|
No Details | 4.0+ | 1.0+ | 6.0+ | no | no | no |
|
|
|||||||
|
href
: String
Complete text of the URL of the link.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 5.0+ | 1.0+ |
|
|||||||
|
Path name portion of the URL of the link. (e.g. "/docs/index.html")
|
No Details | 4.0+ | 1.0+ | 6.0+ | no | no | no |
|
|
|||||||
|
Port portion of the URL of the link.
|
No Details | 4.0+ | 1.0+ | 6.0+ | no | no | no |
|
|
|||||||
|
Protocol portion of the URL of the link. ("http" or "https")
|
No Details | 4.0+ | 1.0+ | 6.0+ | no | no | no |
|
|
|||||||
|
Query string portion of the URL of the link.
|
No Details | 4.0+ | 1.0+ | 6.0+ | no | no | no |
|
|
|||||||
|
Text between the <a> and </a> tags.
|
No Details | 3.0+ | 1.0+ | 2.0+ | no | no | no |
|
|
|||||||
References
Anchor|Location|HTMLAnchorElement
Availability
JavaScript 1.0|enhanced in JavaScript 1.1|W3C