leijuanjuan 2010-10-22 16:28
浏览 154
已采纳

js动态加载元素

[code="java"]



function d(){ var button = document.frames["a"].document.createElement("button"); var text = document.frames["a"].document.createTextNode("ddd"); button.appendChild(text); document.frames["a"].document.appendChild(button); }

[/code]

createElement("button");

为什么把button改成createElement("p");就不能显示

  • 写回答

6条回答 默认 最新

  • lizhiyezi 2010-10-22 17:06
    关注

    input 对象不支持appendChild函数肯定直接报错。当docuemnt.appendChild能添加

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(5条)

报告相同问题?