Javascript examples for Math:random
Generate random number and place it inside image URL
<html> <head> <meta name="viewport" content="width=device-width"> </head> <body> <img id="the-image" src="https://example.com/number="> <script> var image = document.querySelector('#the-image'); var number = Math.random()*10000000000000000; image.src += number;//w w w .ja va 2 s . c o m console.log(image.src) </script> </body> </html>