Anchors array : Anchor « HTML « JavaScript DHTML






Anchors array

   

<html>
<body>

<script type="text/javascript">
function linkToAnchor(num){
    var win2=open("http://www.java2s.com","secondLinkWindow",
                    "scrollbars=yes,width=250,height=200")
    win2.location.hash=num
}
</script>

<h3>Links and Anchors</h3>
<form>
<input type="button" value="0" onClick="linkToAnchor(this.value)">
<input type="button" value="1" onClick="linkToAnchor(this.value)">
<input type="button" value="2" onClick="linkToAnchor(this.value)">
<input type="button" value="3" onClick="linkToAnchor(this.value)">
</form>

</body>
</html>


           
         
    
    
  








Related examples in the same category

1.Anchor 'target' Example
2. A Document with Anchors
3.Reading the Number of Anchors
4.Properties of the Anchor Object
5.Return the number of anchors in a document
6.List anchor in a document
7.Anchor on mouse over event
8.Anchor on click event
9.on mouse over action for anchor link
10.Create a hyper link element and set the id and href attributes
11.Presenting Different Content for Scriptable and Nonscriptable Browsers
12.Links with Custom Status-Bar Messages
13.Create anchor tag and output
14.Using Anchors to Navigate Through a Page
15.String.link()