<html>
<head>
<title>Simple Array Demo</title>
<script>
var description = new Array(3)
var counter = 0;
function initialize(){
description[0] = "blank";
description[1] = "triangle";
description[2] = "circle";
description[3] = "square";
}
function upDate(){
counter++;
if (counter > 3){
counter = 0;
}
document.myForm.txtDescription.value = description[counter];
}
</script>
</head>
<body onLoad = "initialize()">
<center>
<h1>Simple Array Demo<hr></h1>
<form name = "myForm">
<input type = "text" value = "blank" name = "txtDescription">
<br>
<input type = "button" value = "next" onClick = "upDate()">
</form>
</center>
<hr>
</body>
</html>
|