源代碼
點擊運行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>教程</title> </head> <body> <p>x=5, 返回 x===5 的比較值結果。</p> <button onclick="myFunction()">嘗試一下</button> <p id="demo"></p> <script> function myFunction() { var x=5; document.getElementById("demo").innerHTML=x===5; } </script> </body> </html>
運行結果