Easy Tutorial
❮ Jsref Reduceright Prop Video Controller ❯

Location hash Property

Location Object


Definition and Usage

The hash property is a read-write string representing the anchor part of the URL (the part starting with the # symbol).

Syntax


Browser Support

All major browsers support the hash property.


Example

Return the main part of a URL. Assuming the current URL is http://www.tutorialpro.org/test.htm#PART2:

document.write(location.hash);

The output of the above example is:

#part2

Location Object

❮ Jsref Reduceright Prop Video Controller ❯