Use array to store the image names
<html>
<head>
<title>A Simple Page</title>
<script language="JavaScript">
var myarray = new Array("","","","","","","","","","");
for (x in myarray)
{
myarray[x] = "img" + x + ".gif";
}
alert(myarray);
</script>
</head>
<body>
</body>
</html>
Related examples in the same category