0

Random images that slide next && prev in html///it's working but I can't seem to find a way to generate a random number i->i.jpg

<html> <head> <title>my Site</title> </head> <div style="background-color:grey"> <marquee direction="right"> <h1> <b>This is my Site</b> </h1> </marquee> </div> <body> <!--initialization of new img--> <script> function gen() { var i=1; return i; } </script> <form onShow="gen()"> <!--generation of prev img num--> <button> <a href="5.jpg" width="300px" height="280px">Prev</a> </button> <!--generation of next img num-->

18th Jun 2017, 9:16 PM
thomo
thomo - avatar
1 Antwort
0
Use following code to generate random number from 1 to 100: let randNum = ~~(Math.random()*100) +1;
18th Jun 2017, 10:12 PM
Calviղ
Calviղ - avatar