源代码
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>享学课堂</title> </head> <body> <p>显示布尔值:(10 > 9):</p> <button onclick="myFunction()">试试</button> <p id="demo"></p> <script> function myFunction() { document.getElementById("demo").innerHTML = Boolean(10 > 9); } </script> </body> </html>
运行结果