编辑下面的代码:【加编码】
<html> <body> <p>你可以在一个语句中声明多个变量:</p> <button onclick="myFunction()">点我</button> <p id="demo"></p> <script> function myFunction() { var lastName = "Doe", age = 30, job = "carpenter"; document.getElementById("demo").innerHTML = "Name: " + lastName + ". Age: " + age + ". Work: " + job; } </script> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂