Interactive online courses HTML Academy
2026-03-09 14:08 Diff

We found all of the images on the page. All that is now left for you to do is program the logic. The interaction should work as follows: The user clicks on the preview. → The large image changes.

The first step is to add click handlers for each thumbnail. All of the thumbnails are stored in the thumbnails collection. We can search through this collection in a loop by adding a click handler to the current item in the collection. So we add a handler to each thumbnail.

Inside the handler, output a string to the console and then try to click on the thumbnails. This will allow us to test that the handlers work.