<table width="100%" border="0" cellspacing="0" cellpadding="0" id="theTable">
          <tr> 
            <td id='aaa'><input type='text'></td>
          </tr>
</table><input type='button' value='添加一行' onclick="document.all.aaa.innerHTML += '<br><input type=\'text\'>'">

解决方案 »

  1.   

    使用document.write 方法,例如
    document.write ("<input type=text name=append >")
      

  2.   


                <table width="95%" border="0" cellpadding="0" cellspacing="0" align="right">
                  <tr> 
                    <td class="l14" width="98%">&nbsp; </td>
                  </tr>
                  <tr> 
                    <td class="l14" width="98%"> 
                      <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
                        <tr> 
                          <td> 
      <table border="0" cellpadding="0" cellspacing="2" style="border-collapse: collapse; font-size:12px;" id="AutoNumber1">
      <form method="POST" name="smForm" action="">
        <tr>
          <td width="20%" align="right" valign=top>订单明细:</td>
          <td width="80%">
          <script language="javascript">
    function setList()
    {
    str='';
    if(!window.smForm.upcount.value)
    window.smForm.upcount.value=1;
      for(i=1;i<=window.smForm.upcount.value;i++)
       str+='<INPUT type="text" id="txtNo'+i+'" name="txtNo'+i+'" size="27"> <INPUT type="text" id="txtNum'+i+'" name="txtNum'+i+'" size="27"> <INPUT type="text" id="txtRe'+i+'" name="txtRe'+i+'" size="27"><br>';
    window.lstItem.innerHTML=str+'<br>';
    }
    </script>
    <input type="text" name="upcount" value="5">
            <input type="button" name="Button" onclick="setList();" value="设定(C)" accesskey=c><span style="color:#ff4500">(有订单意向者填写)</span>
          </td>
        </tr>
        <tr>
    <td colspan="2">
    <TABLE WIDTH=100% BORDER=1 CELLSPACING=0 CELLPADDING=0 bordercolordark=White bordercolorlight=Black>
    <TR align=center>
    <TD>货号</TD>
    <TD>数量</TD>
    <TD>备注</TD>
    </TR>
    </TABLE>
    </td>
        </tr>
        <tr>
    <td colspan="2" id="lstItem">
    <INPUT type="text" id="txtNo1" name="txtNum1"><INPUT type="text" id="txtNum1" name="txtNum1"><INPUT type="text" id="txtRe1" name="txtRe1">
    </td>
        </tr>
        <tr>
    <td colspan=2 align=center>
    <input type="submit" value="发送邮件(S)" name="send" accesskey="s">
    <input type="reset" value="重写(R)" name="reset" accesskey="r">
    <span style="width:20px;"></span>
        </td></tr>
        </form>
        </table>
        </center>
        <script language="javascript">
    setList();
    </script>                      </td>
                        </tr>
                      </table>