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