Plz help | SoloLearn: Learn to code for FREE!


Plz help

When I run this code it comes with an error.

11/13/2019 7:34:32 AM

Shreyansh [ #mememinati ]

7 Answers

New Answer


Try using : document.getElementById("img"); [Assuming you have an image with an id value img].


Tru using this : var x=Math.floor(Math.random()*i); Math.random() is used only to get random values between 0 and 1 like 0.4562737 or 0.818717 which when multiplied by any value of i will be 0. So you can floor down the result which gives you the exact number.


My pleasure 😊👍


Nova thanks it worked I was using square brackets


Nova plz help This code works fine when I output any specific image but I want to generate random images


Nova thanks bro I had been trying this for last few days


Nova I've tried Here is the link of code