多行声明多个变量

  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",
  13. carName = "porsche",
  14. price = 150000;
  15. document.getElementById("demo").innerHTML = carName;
  16. </script>
  17.  
  18. </body>
  19. </html>