<html>
<head>
<title> Using the form elements property</title>
</head>
<body>
<script language="JavaScript">
<!--
function getName(){
var textName = document.form1.elements[0].name;
alert("The textbox name is: " + textName);
}
-->
</script>
<form name="form1">
This is a blank input textbox. Click on the button below to get the name of the textbox.
<br>
<input type="text" name="textbox1" size=25>
<br><br>
<input type="button" value="Get Name" onClick = getName()>
</form>
</body>
</html>
|