how can I change the image source via javascript I’ve tried const charmImage = document.getElementById(‘charmImage’); followed by charmImage.src = ‘./assets/images/Blank-Charm.png’; but it never works, the image is in the correct folder. When I do an inspect on the page I see that every image has a hash added to the name… So is it possible to change the source of an img in my js file???
Hi Bill,
I’d be happy to help you figure this out, can you provide your current code?
I have an image displayed after the scene code in my body like this
I’ve tried code like
const characterTitleCard = document.getElementById(‘snowMan’)
characterTitleCard.src = ‘’./assets/images/turkey.png"
I’ve tried this a number of ways but it seems when items are placed on the screen they include a hash so I’m think this is impossible, I am now putting all name tags on screen and only turning on the ones I want… if you have any suggestions please let me know
It should be assets/images/turkey.png
.
The Asset Manager will handle the rest of the path. Could you share an example of what the URL looks like when your code executes?