applyElement与appendChild区别的问题?
<SCRIPT>
function fnApply1(){
var oNewNode =document.createElement( " <INPUT type=button name=newname
value=提交> ");
var obj=document.getElementById( 'test ');
obj.appendChild(oNewNode);
alert(obj.innerHTML);
}
function fnApply2(){
var oNewNode1 =document.createElement( "INPUT type=button ");
var obj1=document.getElementById( 'test ');
obj1.applyElement(oNewNode1, "inside ");
alert(obj1.innerHTML);
}
</SCRIPT>
<div id=test> fsda </div>
<input type=button> </input>
<INPUT TYPE= "button " VALUE= "appendChild "onclick= "fnApply1() ">
<INPUT TYPE= "button " VALUE= "applyElement "onclick= "fnApply2() ">
上面代码之上面的按钮可以添加按钮,为什么下面的就不行呢?
applyElement与appendChild具体区别?最好举例
------解决方案--------------------看看DHTML手册!