编辑下面的代码:【加编码】
<html> <body> <p id="demo">点击按钮合并数组。</p> <button onclick="myFunction()">点我</button> <script> function myFunction() { var hege = ["Cecilie", "Lone"]; var stale = ["Emil", "Tobias", "Linus"]; var children = hege.concat(stale); var x=document.getElementById("demo"); x.innerHTML=children; } </script> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂