August 1999
Intermediate to advanced
1488 pages
72h 53m
English
link.hash
The hash property represents a portion of the currently displayed URL.
Listing 7.360 shows an example of how the hash property is used. When the button is clicked, the showHash() function displays the value of the hash property for the link.
<html>
<head>
<title> Using the hash property of the Link object</title>
</head>
<body>
<script language="JavaScript">
<!-- Hide
// function shows the hash value of the link
function showHash(){
document.form1.text1.value = document.links[0].hash;
}
// End Hide --->
</script>
Click the button to see the hash for the URL <form name="form1"> <a href=http://www.mcp.com:80/foo?something#foobar> ... |
Read now
Unlock full access