2008/12/16 16:28
createElement, appendChild, removeChild 를 이용한 엘리먼트 추가/삭제
2008/12/16 16:28 in 웹디자인 (HTML,SC)

<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>
Prev

Facebook

