Location hash Property
Definition and Usage
The hash property is a readable and writable string that is the anchor part of the URL (the part starting with #).
Syntax
location.hash
Browser support





All major browsers support the hash property.
Example
Example
Return the main part of a URL. Assume the current URL is http://www.runoob.com/test.htm#PART2:
document
.
write
(
location
.
hash
)
;
The example above produces the following output:
#part2
Location object