<div class="codetitle"> <span><a style="CURSOR: pointer" data="49815" class="copybut" id="copybut49815" onclick="doCopy('code49815')"><u>复代码码</u></a></span> 代码如下:</div> <div class="codebody" id="code49815"> <br><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 전환//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <br><html xmlns="http://www.w3.org/1999/xhtml" > <br><머리> <br><title>add_line</title> <br><script 언어="javascript" type="text/jscript"><!-- <br><br>function add_input_file(tbfile, index) <BR>{ <BR>file_name = "file" 색인; <BR>var tr_file = document.createElement("tr"); <BR>var td_file = document.createElement("td"); <BR>var input_file = document.createElement("input") <BR>input_file.setAttribute("type","file") <BR>input_file.setAttribute("size","50") <BR>input_file.setAttribute ("이름",파일_이름) <br><br>td_file.appendChild(input_file) <BR>tr_file.appendChild(td_file) <BR>tbfile.appendChild(tr_file) <BR>} <BR>함수 add_one_file() <BR>{ <BR>var tb_file = document.getElementById("upload_file"); <BR>var count_file = document.getElementById("upload_file").childNodes.length; <BR>//window.alert(steps_nums); <BR>add_input_file(tb_file, count_file); <BR>} <br><br>// --></script> <br></head> <br><본문> <br><div style="text-align: center" style="text-align: center"> <br><양식> <br><테이블 너비="90%"> <br><tr> <br><td> <br><BR /> <br><BR /> <br><h5>配置文件上传</h5> <br></td> <br></tr> <br><tr> <br><td> <br><table id="upload_file"> <br><tr class="tabletext"> <br><td><input type="file" name="job" size="50"/></td> <br></tr> <br><tr class="tabletext"> <br><td><input type="file" name='file2' size="50"/></td> <br></tr> <br><tr class="tabletext"> <br><td><input type="file" name='file3'size="50"/></td> <br></tr> <br></테이블> <br></td> <br></tr> <br><br><tr> <br><td align="왼쪽"> <br><input type="button" value="새로운 일행" onclick="add_one_file()"/> <br><input type="submit" value="保 存"/> <br><input name="ciname" value="{{ciname}}"/> <br><input name="type" value="default"/> <br></td> <br></tr> <br></테이블> <br></form> <br></div> <br></body> <br></html> <br> </div> <br>把所 유释 <br><br>문서 .createElement 创建一种页면标签 <br>setAttribute:为某一标签设置属性 <br>appendChild:재另一标签中添加一子标签