HTML DOM Anchor object
Anchor object
The Anchor object represents an HTML hyperlink.
The Anchor object is created every time a label appears in an HTML document.
An anchor can be used to create a link to another document (via the href property) or to create bookmarks within the document (via the name property).
You can access the anchor by searching for an array of anchors in the Document object, or by using document.getElementById().
Anchor object properties
W3C: W3C standard.
Attributes | describe | W3C |
---|---|---|
charset | Set or return the character set of the linked resource. | Yes |
href | Set or returns the URL of the linked resource. | Yes |
hreflang | Set or return the language code of the linked resource. | Yes |
name | Set or return a name of a link. | Yes |
rel | Set or returns the relationship between the current document and the target URL. | Yes |
rev | Set or return the relationship between the target URL and the current document. | Yes |
target | Set or return to where to open the link. | Yes |
type | Set or return the MIME type of the resource being linked. | Yes |
Standard properties and events
Anchor objects also support standard properties and events.