[JavaScript] JavaScript通过Max函数返回两个数字中较大的那个 →→→→→进入此内容的聊天室

来自 , 2020-07-29, 写在 JavaScript, 查看 111 次.
URL http://www.code666.cn/view/75a7c30f
  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4.  
  5. <p id="demo">Click the button to return the highest number of 5 and 10.</p>
  6.  
  7. <button onclick="myFunction()">Try it</button>
  8.  
  9. <script>
  10. function myFunction()
  11. {
  12. document.getElementById("demo").innerHTML=Math.max(5,10);
  13. }
  14. </script>
  15.  
  16. </body>
  17. </html>
  18.  
  19.  
  20.  
  21. //javascript/7875

回复 "JavaScript通过Max函数返回两个数字中较大的那个"

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

captcha