Use JS dynamic table

xiaoxiao2021-03-06  108

VAR i = 1;

Function addNewROWS ()

{

if (Keycode = 13)

{

IF (i> = 20)

{

Alert ('can't exceed 20 ");

Return False;

}

Var mytable = document.all ("testtable"

// Get the table object

Var maxcell = myTable.Rows (0) .Cells.Length; // Get the table number

Var mynewrow = myTable.InsertRow ();

MyNewcell = mynewrow.insertcell ();

MyNewcell.innertext = "SSSS"

MyNewcell = mynewrow.insertcell ();

MyNewcell.innerhtml = '

"

MyNewcell = mynewrow.insertcell ();

MyNewcell.innerhtml = '

"

MyNewcell = mynewrow.insertcell ();

MyNewcell.innerhtml = '

1';

MyNewcell = mynewrow.insertcell ();

MyNewcell.innerhtml = '

"

Document.form1.hidden1.value = i;

i;

}

}

转载请注明原文地址:https://www.9cbs.com/read-102953.html

New Post(0)