Copy Code code as follows:
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<title>add_line</title>
<script language= "javascript" type= "Text/jscript" ><!--
function Add_input_file (tbfile, index)
{
file_name = "file" + index;
var tr_file = document.createelement ("tr");
var td_file = document.createelement ("TD");
var input_file = document.createelement ("input")
Input_file.setattribute ("type", "File")
Input_file.setattribute ("Size", "50")
Input_file.setattribute ("name", file_name)
Td_file.appendchild (Input_file)
Tr_file.appendchild (Td_file)
Tbfile.appendchild (Tr_file)
}
function Add_one_file ()
{
var tb_file = document.getElementById ("Upload_file");
var count_file = document.getElementById ("Upload_file"). Childnodes.length;
Window.alert (steps_nums);
Add_input_file (Tb_file, count_file);
}
--></script>
<body>
<div style= "Text-align:center" style= "Text-align:center" >
<form>
<table width= "90%" >
<tr>
<td>
<br/>
<br/>
</td>
</tr>
<tr>
<td>
<table id= "Upload_file" >
<tr class= "Tabletext" >
<td><input type= "file" name= "job" size= "/></td>"
</tr>
<tr class= "Tabletext" >
<td><input type= "file" Name= ' file2 ' size= "/></td>"
</tr>
<tr class= "Tabletext" >
<td><input type= "file" Name= ' File3 ' size= "/></td>"
</tr>
</table>
</td>
</tr>
<tr>
<TD align= "Left" >
<input type= "button" value= "New Row" onclick= "Add_one_file ()"/>
<input type= "Submit" value= "Save"/>
<input name= "Ciname" value= "{Ciname}}"/>
<input name= "type" value= "Default"/>
</td>
</tr>
</table>
</form>
</div>
</body>
Put all the code under the Save as an HTML file, open in the browser, click the "New Line" button can be, the following is the JS function explanation
Document.createelement Create a page label
SetAttribute: Set properties for a label
AppendChild: Add a child label to another label