Validate Link : Hyper Link : HTML JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » HTML » Hyper Link »

 

Validate Link



<html>
<head>
<script language="JavaScript">
<!--
function validateLink(theLink) {
 if (parseInt(theLink> document.anchors.length)
    alert("Sorry, this anchor has not been defined");
 else
    location.hash = theLink;
}
//-->
</script>
</head>
<body>
<form>
<input type="button" value="Chapter 1" onClick="validateLink('0')">
<input type="button" value="Chapter 2" onClick="validateLink('1')">
</form>

<a name="0">CHAPTER 1</a>
<p>  Put some more text in here ...</p>


<a name="1">CHAPTER 2</a>
<p>  Put some more text in here ...</p>
</body>
</html>



           
       



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo HTML
» Hyper Link