Problem using eventhandler to show video on subpage according to which image was clicked on mainpage (html, javascript , css)

I’m a noob in html, css and javascript and i’m making a project for my students.
I’ve made a main page called index.html and a subpage called visningsside.html (pardon the danish) and linked to external CSS and Javascript (which works fine).
I want two images called film1 and film2 to tricker a function, when clicked. The function should, according to which image was clicked, load an iframe with embeded-link to youtube on the subpage, and change the page to show the sub page.
The page changes, when the images are clicked, but the iframe isn’t changing.
I’m using replit as editor.

You can see, comment, edit and run the project at replit

I’ve tried to add DOMContentLoaded to the script in order to avoid problems with html-elements not loaded before the script executes. Perhaps i should try to use onclick instead of an eventlistener, but i thought it was nice to use event target as a parameter to determine which image was clicked.