Example 1:
<HTML>
<Head>
<SCRIPT Lanuage = "JavaScript">
VaR COUNT = 1;
Function TT ()
{
VaR OBJ = Document. Forms [0]. getelementsbytagname ("input ");
If (count> 9 | OBJ [obj. Length-1]
. Value= "")
Return alert ("You have not selected to upload files or the number of uploaded files has reached 10! ");
VaR newrow = AA. insertrow (). insertcell ();
Newrow. innerhtml + = "<input type = 'file' name = 'url" + (++ count) + "'size = 20 class = 'txt '> ";
}
</SCRIPT>
</Head>
<Form>
<Table id = "AA" width = "300" border = "1" cellpadding = "0" cellspacing = "0"
Bordercolorlight = "black" bordercolordark = "white">
<Tr> <TD>
<Input type = "file" name = "url1" size = "20">
</TD> </tr>
</Table>
<Button id = "addbutton"Onclick= "TT ();"> Add another file selection box </button> <br/>
<ButtonOnclick= "Alert (document. Forms [0]. innerhtml);"> display form HTML </button>
</Form>
</Html>
Example 2:
<Body>
<Script language = "JavaScript">
<! --
VaR otable = too many Doc ument. createelement ("table ");
Otable. Border = 1;
VaR OTR = otable. insertrow ();
VaR OTD = OTR. insertcell ();
OTD. innertext = "1.1 ";
OTD = OTR. insertcell ();
OTD. rowspan = 2;
OTD. innertext = "1.2/2.2 ";
OTR = otable. insertrow ();
OTD = OTR. insertcell ();
OTD. innertext = "2.1 ";
Document. Body. appendchild (otable );
// -->
</SCRIPT>
</Body>