0

Question on Arrays

I am trying to use a global variable "BeatlesArray;" and then put the BeatlesArray = new Array() at the window.onload. In a function, I am trying to use a for or a for(in) loop to retain each of the Beatles Names each time their image is clicked (this can be clicked an unlimited amount of times) (each beatles img has a unique id in the HTML, eg. <img id="john" src= "john.jpg"> Then I have a button that when clicked, displays the beatles' names for every time the image was clicked. Any help? Or advice? Thank

28th Sep 2017, 3:45 PM
samuel
3 Respostas
+ 1
Thank you!!!
28th Sep 2017, 4:58 PM
samuel