[JavaScript] JavaScript返回0-1之间的随机数 →→→→→进入此内容的聊天室

来自 , 2019-02-05, 写在 JavaScript, 查看 151 次.
URL http://www.code666.cn/view/e5abba84
  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4.  
  5. <p id="demo">Click the button to display a random number.</p>
  6.  
  7. <button onclick="myFunction()">Try it</button>
  8.  
  9. <script>
  10. function myFunction()
  11. {
  12. document.getElementById("demo").innerHTML=Math.random();
  13. }
  14. </script>
  15.  
  16. </body>
  17. </html>
  18.  
  19. //javascript/7874

回复 "JavaScript返回0-1之间的随机数"

这儿你可以回复上面这条便签

captcha