<script language="javascript">
  var theCount =1;
  function CreateObj()
  {       
  
   var board = document.getElementById("tdUpfileID");  
   var newNode = document.createElement("<br>");
   var e2 = document.createElement("select");
   board.appendChild(newNode);
   board.appendChild(e2);      
   var e = document.createElement("input");
   e.type = "file";
   e.size = 40;
   e.name = "upfile" + theCount;       
   board.appendChild(e);
   theCount++;
      return false;
  }
 </script>
 <form id="form1" name="form1" method="post" action="">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
  <td id="tdUpfileID"><select name="select">
    <option value="1">1</option>
    <option value="2">2</option>
  </select>
<input name="upfile" type="file" id="upfile" size="40"><a href="#" onClick="CreateObj()">+</a></td>
    </tr>
  </table>
</form>
 

解决方案 »

  1.   

    你新创建的select没有添加opetion,所有就没有内容啊,可以这样<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
     <head>
      <title> New Document </title>
     </head> <body>
      <script language="javascript">
      var theCount =1;
      function CreateObj()
      {       
      
       var board = document.getElementById("tdUpfileID");  
       var newNode = document.createElement("<br>");
       var e2 = document.getElementById("selec").cloneNode(true);
       board.appendChild(newNode);
       board.appendChild(e2); 
       var e = document.createElement("input");
       e.type = "file";
       e.size = 40;
       e.name = "upfile" + theCount;       
       board.appendChild(e);
       theCount++;
          return false;
      }
     </script>
     <form id="form1" name="form1" method="post" action="">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
      <td id="tdUpfileID"><select name="select" id="selec">
        <option value="1">1</option>
        <option value="2">2</option>
      </select>
    <input name="upfile" type="file" id="upfile" size="40"><a href="#" onClick="CreateObj()">+</a></td>
        </tr>
      </table>
    </form> </body>
    </html>
      

  2.   

    在ie6下是可以的,在ff下是不符合浏览器自身的标准