原文链接:https://zhidao.baidu.com/question/586477237.html
把要输出的html全部写在某个id中,然后复制过去,你想放多少都行
<script type="text/javascript"> window.onload=function(){ var _acon=document.getElementById("aaa").innerHTML; var _bbb=document.getElementById("bbb"); _bbb.innerHTML=_acon; } </script> <div id="aaa"> <div class="test"> <ul> <li>aaaaaaa</li> <li>bbbbbbb</li> <li>ccccccc</li> </ul> </div> </div> <div id="bbb"></div>