显示 Boolean(10 > 9) 的值

  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4.  
  5. <p>显示 Boolean(10 > 9) 的值:</p>
  6.  
  7. <button onclick="myFunction()">试一试</button>
  8.  
  9. <p id="demo"></p>
  10.  
  11. <script>
  12. function myFunction() {
  13. document.getElementById("demo").innerHTML = Boolean(10 > 9);
  14. }
  15. </script>
  16.  
  17. </body>
  18. </html>