A Document with Anchors : Location « Window Browser « JavaScript DHTML






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

1.Location property
2.Methods and Properties of the Location Object
3.Jump to a new location
4.Extracting the Directory of the Current Document