Anchor Object
The name property sets or returns the value of the name attribute of a link.
The name attribute specifies the name of an anchor, and is used to create a bookmark inside a document.
Set the name property:
Return the name property:
| Value | Description |
|---|---|
| name | Specifies the name of the anchor |
![]()
The name property is supported in all major browsers.
Return the name of a specific anchor:
The output of the code above will be:
Anchor Object
Your message has been sent to W3Schools.