源代码
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>享学课堂</title> </head> <body> <p>给x赋值5, 显示(x != 8)的比较结果.</p> <p id="demo"></p> <script> var x = 5; document.getElementById("demo").innerHTML = (x != 8); </script> </body> </html>
运行结果