Skip to content
Advertisement

Javascript Won’t replace image

My Js code below is a quiz game. Each question takes up a full page, which means we have to change all the content every time the user presses the next button.

My issue is, i can’t seem to get the image to switch to the next by fully replacing it. In my case the new images just go to the bottom of the first.

JavaScript
JavaScript
JavaScript

Advertisement

Answer

Where you have your

JavaScript

Change it to this:

JavaScript

This will clear out the previous image and the new one will be added in.

Hope this helps.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement