源代码
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>享学课堂</title> </head> <body> <h1>JavaScript 语句</h1> <p>语句由分号分隔</p> <p>变量 x, y和z,被赋值为5, 6和11.</p> <p>然后z的值显示在下面的段落中:</p> <p id="demo"></p> <script> var x, y, z; x = 5; y = 6; z = x + y; document.getElementById("demo").innerHTML = z; </script> </body> </html>
运行结果