Here is the image that I would like to use (HTML path - "Marlene.jpg"):
<div class="startpanel panel transition current">
<div class="image" style="background:url('../../Doggo-particular/dist/pictures/Marlene/Marlene.jpg') 50% 50%; background-size:cover;">
</div>
This is the javascript code where I need to put the picture:
var possible_results = [
{
name: "Marlene",
//THE ANIMALS CHARACTERISTICS BY WHICH ITS MEASURED:
colourfulness: 10,
hairiness: 10,
landiness: 55,
size: 80,
carnivore: 0,
scariness: 40,
sociability: 70,
//THE SCORE IT GETS COMPARED TO THE QUIZ TAKER:
similarity: 0,
//BITS FOR THE RESULTS PANEL:
desc: "Bold, beautiful and brilliant - your best match is Marlene!<br> You're intelligent and powerful. Your friends love you and whilst no-one wants to mess with you, everyone agrees - you are great! <br> In the wild there are only 600,000 African elephants and it is officially classed as vulnerable.",
img: "../../Doggo-particular/dist/pictures/Marlene/Marlene.png",
I have used this website as a tutorial:
https://moonbooks.org/Articles/How-to-add-an-image-in-a-HTML-page-using-javascript-/
The path on "img:" does not work and the code reference from the website gives me errors . Can someone help me on how to display the image? I wouldnt mind placing the picture in the same folder and then calling it, I tried this method as well and it did not work.