Simple Array Demo : Array : Language Basics JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Language Basics » Array »

 

Simple Array Demo



<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>

 

           
       



-

Leave a Comment / Note


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

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Language Basics
» Array