Generate random number in JavaScript
home
Run
screen_rotation
fullscreen
cloud_download
<html> <head> <title>Javascript Demo</title> <script type='text/javascript'> function getRandomNumber(start, end) { var ranNumber = Math.floor(Math.random() * (end - start + 1)) + start; document.getElementById('result').innerHTML= ranNumber; } </script> </head> <body> <a href="javascript:void(0)" onclick=" getRandomNumber(0, 1000) ">Generate Number </a> <p id='result'></p> </body> </html>
<html> <head> <title>Javascript Demo</title> <script type='text/javascript'> function getRandomNumber(start, end) { var ranNumber = Math.floor(Math.random() * (end - start + 1)) + start; document.getElementById('result').innerHTML= ranNumber; } </script> </head> <body> <a href="javascript:void(0)" onclick=" getRandomNumber(0, 1000) ">Generate Number </a> <p id='result'></p> </body> </html>
Copyrights@tutorialsplane.com