University student who may need a little help with his programming! Well... a lot then! Struggling with this coursework where you have to guess where the gold is behind the pot, but you only get one chance and 3 lives and I want it to loop round again, thanks! This is my code: lives=3 score=0 document.write(Lives:,lives,<br>); document.write(Score:,score); function clickMeIDFunction(theElementID){ var theElement = document.getElementById(theElementID); theElement.src = nope.gif; } function clickMeIDFunction2(theElementID){ var theElement = document.getElementById(theElementID); theElement.src = `nope.gif`; } function clickMeIDFunction3(theElementID){ var theElement = document.getElementById(theElementID); theElement.src = gold-bar-icon.png; } if (lives=0){ document.write(Game over!); } </script> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p><img id=pot1 src=imageedit_2_3920956067.gif width=238 height=170 class=pot onclick=clickMeIDFunction(`pot1`)> <img id=pot2 src=imageedit_2_3920956067.gif width=238 height=170 class=pot onclick=clickMeIDFunction2(`pot2`)> <img id=pot3 src=imageedit_2_3920956067.gif width=238 height=170 class=pot onclick=clickMeIDFunction3(`pot3`)> </center> </div>
©