-Annie-

printRandomNumbers

May 23rd, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. </head>
  5. <body>
  6.     <input type="submit" onclick="printRandNum()" />
  7. </body>
  8. <script>
  9.     function printRandNum() {
  10.         let num = Math.round(Math.random() * 100);
  11.         document.body.innerHTML += `<div>${num}</div>`;
  12.     }
  13. </script>
  14. </html>
Advertisement
Add Comment
Please, Sign In to add comment