<html>
<head>
<title> Using the href property of the Link object</title>
</head>
<body>
<script language="JavaScript">
<!--
function showhref(){
alert(document.links[0].href);
}
-->
</script>
Click the button to see the href property for the URL
<form name="form1">
<a href="http://www.java2java.com">java2s.com</a>
<br><br>
<input type="button" name="href" value="Get href Value" onClick='showhref()'>
<br>
</form>
</body>
</html>
|