编辑下面的代码:【加编码】
<html> <body> <p>点击按钮创建及增加字符串变量。</p> <button onclick="myFunction()">点击这里</button> <p id="demo"></p> <script> function myFunction() { txt1="What a very"; txt2="nice day"; txt3=txt1+txt2; document.getElementById("demo").innerHTML=txt3; } </script> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂