Anchor name Property
Anchor Object
Definition and Usage
The name property can set or return the value of the link's name attribute.
The name attribute returns the name of a link, usually used to create a bookmark in the document.
Syntax
Set the name attribute:
anchorObject.name="
name
"
Return the name attribute:
anchorObject.name
| Value | Description |
|---|---|
| name | Sets the name of the link. |
Browser support





All major browsers support the name property.
Example
Example
Returns the name of the link:
Chapter 1
This chapter explains ba bla bla
Chapter 2
This chapter explains ba bla bla
Chapter 3
This chapter explains ba bla bla
Chapter 4
This chapter explains ba bla bla
Chapter 5
This chapter explains ba bla bla
Chapter 6
This chapter explains ba bla bla
The example above produces the following output:
Returns the anchor: C6
Try it »
Anchor Object