Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Anchor name Property

Anchor name Property

Anchor Object Reference 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

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the name property.


Example

Example

Returns the name of the link:

Runoob Tutorial(runoob.com)

See Chapter 6

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 Reference Anchor Object