Hello!
I’ve never used javascript before and I’m having so much trouble figuring out how to change the source of one of my image elements. Maybe it’s a syntax issue? I’ve tried multiple different urls and nothing has worked. When the function is called, everything inside it works accept for this piece - it just keeps the original picture. The picture I’m trying to change is an image element inside of a div which is inside of a section which is inside of the body. The code is in: ‘workbench’ page custom code > ‘before tag’ > bottom switch function. My image element ID is “layer1”. I need to be able to change the image on click and all my images are in the assets section of the project. The url I have in my code is the one from the assets section. The button that performs the function(showSelected) is as follows:
doubleNotched.addEventListener(‘click’, (event) => {
lastSelected = doubleNotched;
layer1.style.display = “inline-block”;
showSelected();
});
Here is my read only link, thanks for any help!