I'm facing issues with my JS code and I hope you guys can help me help me. All I want to do is loop 5 images stored in an array, and post them to my HTML page, basically.
JS:
function functieArray(){
for (i = 0; i < imgArray.length; i++) {
imgArray[i];
}
document.getElementById("pozeGallery").innerHTML = imgArray.src;
};
var imgArray = new Array();
imgArray[0] = new Image();
imgArray[0].src = 'img/Gallery/poza0.jpg';
imgArray[1] = new Image();
imgArray[1].src = 'img/Gallery/poza1.jpg';
imgArray[2] = new Image();
imgArray[2].src = 'img/Gallery/poza2.jpg';
imgArray[3] = new Image();
imgArray[3].src = 'img/Gallery/poza3.jpg';
imgArray[4] = new Image();
imgArray[4].src = 'img/Gallery/poza4.jpg';
HTML:
<button onclick='functieArray()' class='galleryButons'>Category 1</button>
<div id='pozeGallery'> </div>