编辑下面的代码:【加编码】
<html> <body> <p> + 号运算符用于连接字符串。</p> <button onclick="myFunction()">点我</button> <p id="demo"></p> <script> function myFunction() { var text1 = "Good "; var text2 = "Morning"; var text3 = text1 + text2; document.getElementById("demo").innerHTML = text3; } </script> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂