源代码
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>享学课堂</title> </head> <body> <h1>JavaScript 语句</h1> <p>允许一行多个语句.</p> <p id="demo1"></p> <script> var a, b, c; a = 1; b = 2; c = a + b; document.getElementById("demo1").innerHTML = c; </script> </body> </html>
运行结果