Random image number | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Random image number

Trying to write some JavaScript that displays a single image a random number of times between 1 and 15 inclusive each time the browser refreshes. I can create the random function no worries: math.floor(math.random() *15) +1; But referencing it to a document.getElementById. I’m struggling with. Any advice??

17th Mar 2021, 11:10 AM
Kristian
Kristian - avatar
1 Answer
+ 3
Sure anyone can help if you would share your code link
17th Mar 2021, 11:15 AM
Sharique Khan
Sharique Khan - avatar