Creating static variables is not an option in this case becouse it would take to long time and ineffective to what im trying to accomplish. I have an Array with images and I'm trying to create a way to make divs according to the length of the array. 1,2,3,4 etc.
var images = ['image1.JPG', 'image2.JPG', 'image3.JPG'];
var totalimages = images.length;
Which will result in an array length of 3. I would like to create 3 variables for this.
for (var i = 0; i > totalimages; i++){
var div[i] = document.createElement('div');
}
This seems not to be working for some reason. I tried to create a div array/list outside the for loop aswell.
var div = [];
for (var i = 0; i > totalimages; i++){
var div[i] = document.createElement('div');
}
Still not working. I dunno why this is not working. Javascript only
EDIT: (not working) i mean it gives me syntax error.
varinside the loop.div?