一行允许多条语句

  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4.  
  5. <h2>JavaScript 语句</h2>
  6.  
  7. <p>一行允许多条语句。</p>
  8.  
  9. <p id="demo1"></p>
  10.  
  11. <script>
  12. var a, b, c;
  13. a = 5; b = 6; c = a + b;
  14. document.getElementById("demo1").innerHTML = c;
  15. </script>
  16.  
  17. </body>
  18. </html>