在一条语句中声明多个变量

  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4.  
  5. <h1>JavaScript 变量</h1>
  6.  
  7. <p>您可以在一条语句中声明许多变量。</p>
  8.  
  9. <p id="demo"></p>
  10.  
  11. <script>
  12. var person = "Bill Gates", carName = "porsche", price = 150000;
  13. document.getElementById("demo").innerHTML = carName;
  14. </script>
  15.  
  16. </body>
  17. </html>