...

View Full Version : for loop not working



andrew1234
07-17-2009, 07:42 PM
Hi Why wont my for loop work

it wont alert the var images1....

Thanks





<script type="text/javascript">

for(i=1;i<6;i++){

images[i] = "no"+i+".jpg";
alert(images[i]);
}

</script>

ckeyrouz
07-17-2009, 08:00 PM
Declare the variable images;


var images = [] or var images = new Array()

andrew1234
07-17-2009, 08:02 PM
thanks so much



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum