The hash property represents a portion of the currently displayed URL.
<html>
<head>
<title> Using the hash property of the Link object</title>
</head>
<body>
<script language="JavaScript">
<!--
function showHash(){
alert(document.links[0].hash);
}
-->
</script>
Click the button to see the hash for the URL
<form name="form1">
<a href="http://www.java2s.com">java2s.com</a>
<br><br>
Hash value: <input type="text" name="text1" size=20>
<br>
<input type="button" name="hash" value="Get hash value" onClick='showHash()'>
<br><br>
</form>
</body>
</html>