HTML DOM hash Property
Definition and Usage
The hash property sets or returns the URL from
the hash sign (#).
The hash property specifies an anchor name in a URL.
Syntax
Example
This example get the hash part from a location.
(like "#part2" from http://example.com/test.htm#part2)
<html>
<body>
<script type="text/javascript">
document.write(location.hash);
</script>
</body>
</html>
|
|
Try-It-Yourself Demos
Anchors array
- This example opens two windows. The first window contains four buttons and the
second window defines four anchors from 0 to 3. When a button is clicked in the
first window, the onclick event handler goes to the specified anchor in the
second window.
 |
W3Schools' Online Certification Program
The perfect solution for professionals who need to balance work, family, and career building.
More than 3500 certificates already issued!
|
The HTML Certificate documents your knowledge of HTML, XHTML, and CSS.
The JavaScript Certificate documents your knowledge of JavaScript and HTML DOM.
The XML Certificate documents your knowledge of XML, XML DOM and XSLT.
The ASP Certificate documents your knowledge of ASP, SQL, and ADO.
The PHP Certificate documents your knowledge of PHP and SQL (MySQL).
|