btn.onclick=function(){var iframe = document.getElementsByTagName("iframe")[0];var oldNode=iframe.contentDocument.getElementById('myNode');var newNode=document.importNode(oldNode,true);document.body.appendChild(newNode);}这个能执行,下面就执行不了var iframe = document.getElementsByTagName("iframe")[0];var oldNode=iframe.contentDocument.getElementById('myNode');var newNode=document.importNode(oldNode,true);btn.onclick=function(){document.body.appendChild(newNode);}
添加回答
举报
0/150
提交
取消