W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<!DOCTYPE html> <html> <body> <h1>JavaScript 变量</h1> <p>字符串用引号包围。</p> <p>数值不用引号包围。</p> <p id="demo"></p> <script> var pi = 3.14; var person = "Bill Gates"; var answer = 'How are you!'; document.getElementById("demo").innerHTML = pi + "<br>" + person + "<br>" + answer; </script> </body> </html>