<script>
function addText()
{
    var txt = document.createElement("input");               
    txt.type="text";
    txt.name="txt1";
    txt.id="txt1";
    td1.appendChild(txt); //加到的位置.
}
</script>
<body>
<input type="button" onclick="addText()" value="add">
<br>
<table><tr><td id="td1">table</td></tr></table>