在一条语句中声明多个变量
- <!DOCTYPE html>
- <html>
- <body>
- <h1>JavaScript 变量</h1>
- <p>您可以在一条语句中声明许多变量。</p>
- <p id="demo"></p>
- <script>
- var person = "Bill Gates", carName = "porsche", price = 150000;
- document.getElementById("demo").innerHTML = carName;
- </script>
- </body>
- </html>