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

HTML DOM Area pathname Property

Area pathname Property

Area Object Reference Area Object


Definition and Usage

The pathname property can set or return the pathname part of the href attribute value.

Syntax

areaObject.pathname=

path


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the pathname property.


Tips and Notes

**Note:** In the following examples, IE and Opera return "jsref/venus.htm", while Firefox, Chrome, and Safari return "/jsref/venus.htm".


Example

Example

The following example returns the pathname in the href attribute value of the "Venus" region:

Runoob Tutorial(runoob.com)

Venus

Path of the Venus region:

Note: IE and Opera browsers return "jsref/venus.htm",

while Firefox, Chrome, and Safari browsers return "/jsref/venus.htm".

The example above produces the following output:

Path of the Venus region: /try/demo_source/venus.htm

Try it »


Area Object Reference Area Object