Question on Arrays | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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
1 Answer
+ 1
Thank you!!!
28th Sep 2017, 4:58 PM
samuel