JavaScript 数字和字符串
- <!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>