运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
转到 Spaces
<!DOCTYPE html> <html> <body> <h1>JavaScript Variables</h1> <p>In this example, x, y, and z are undeclared.</p> <p>They are automatically declared when first used.</p> <p id="demo"></p> <script> x = 5; y = 6; z = x + y; document.getElementById("demo").innerHTML = "The value of z is: " + z; </script> </body> </html>