Location hash property
Definition and Usage
hash property is a readable and writable string that is the anchor part of the URL (from the beginning of the part number #).
grammar
location.hash
Browser Support
All major browsers support hash property
Examples
Examples
Back to the main part of the URL. Suppose the current URL is http://www.w3cschool.cc/test.htm#PART2:
<script>
document.write(location.hash);
</script>
document.write(location.hash);
</script>
Examples of the above output:
#part2
Location Object