2008/12/16 16:28

createElement, appendChild, removeChild 를 이용한 엘리먼트 추가/삭제


<script type="text/javascript">
function add()
{
   var oText = document.createElement("input");
   oText.setAttribute("type", "text");
   oText.setAttribute("id", "txt");
   document.myform.appendChild(oText);
}
function del()
{
   var oText = document.getElementById("txt");
   oText.parentNode.removeChild(oText);
}
</script>

저작자 표시
크리에이티브 커먼즈 라이선스
Creative Commons License

Trackback 0 Comment 0