Availability: |
| ||||||
Property/method value type: | String primitive | ||||||
JavaScript syntax: | - | myUrl.hash | |||||
- | myUrl.hash = aLocation | ||||||
HTML syntax: | <A HREF="..."> <LINK HREF="..."> | ||||||
Argument list: | aLocation | A new named location within the document |
This property yields a text string that contains the hash suffix from the URL if there is one.
You can assign a new value to this property, which will become a new anchor location within the document.
This attribute may not work correctly when URLs are accessed from one frame to another in some versions of MSIE. You should check your target platforms for compliance.
If you assign a value to this property, you should omit the leading hash.
<HTML> <HEAD> </HEAD> <BODY> <A NAME="EXAMPLE" HREF="http://www.mydomain.com/folder/file.html#abcdef">Click here</A><BR> <SCRIPT> // In testing, this did not work in Opera 5.0 document.write(document.links[0].hash); </SCRIPT> </BODY> </HTML>
See also: | Anchor.hash, URL, Url object, Url.href, Url.pathname, Url.port, Url.protocol, Url.search, Url.target |
Prev | Home | Next |
Url.coords | Up | Url.host |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |