생성된 개체를 출력하기 위해서는 appendchild 등록을 해야 한다.
===================================================
<SCRIPT> function fnAppend(){ var oNewNode = document.createElement("LI"); oList.appendChild(oNewNode); oNewNode.innerText="List node 5"; } </SCRIPT> <BODY> <UL ID = oList> <LI>List node 1 <LI>List node 2 <LI>List node 3 <LI>List node 4 </UL>
<INPUT TYPE = "button" VALUE = "Append Child" onclick = "fnAppend()"> </BODY>
|