Javascript array and changing an image with button
Javascript: iteration to change images in DOM Purpose: For the next experiment, it was trying to change an image by button click, and surf through the array in my javascript file. Setup: Remember all files are in the same folder. To replicate this experiment locally on your browser, have your image files, your HTML and your JS in the same folder, replace the file names in the image_array [] with your file names. In my code, you'll see the image paths for my images. Double click that index.html file and see the code run. *Note about frameworks and non-local use of this code* In an actual web app, with something like Django, the images would be in static / images, the html, in templates, and the javascript in the static/js. But why? It's helpful to me to create these little projects so I can explore how things work. I'm sharing as I learn so that maybe this method would be useful to others. Notes Next experiment I will evolve the style more, and try to retriev...