A Document with Anchors : Location « Window Browser « JavaScript DHTML
- JavaScript DHTML
- Window Browser
- Location
A Document with Anchors
<html>
<head>
<title>location.hash Property</title>
<script type="text/javascript">
function goNextAnchor(where) {
window.location.hash = where;
}
</script>
</head>
<body>
<a id="start" name="start">Top</a>
<input type="button" name="next" value="NEXT" onclick="goNextAnchor('sec3')" />
<a id="sec3" name="sec3">Section 3</a>
<input type="button" name="next" value="BACK TO TOP" onclick="goNextAnchor('start')" />
</body>
</html>
Related examples in the same category