Function implementation: Click the Add button, the table adds a row and gives its name attribute to the value, to facilitate access to
Click Delete to delete this line automatically
Define a Count variable in jquery
var count = 1;
function Add () {
var tbl = document.all.ci;
var rows = tbl.rows.length;
var tr = tbl.insertrow (rows);
var e_id = Tr.insertcell (0);
e_id.innerhtml = ' <input type= ' text ' name= ' e_id ' + count + ' ' size= ' 7 '/> ';
var class_id = Tr.insertcell (1);
class_id.innerhtml = ';
var memo = Tr.insertcell (2);
memo.innerhtml = ' <input type= ' text ' name= ' memo ' + Count + ' size= '/> ';
var del = Tr.insertcell (3);
del.innerhtml = ' <input type= button ' onclick= ' del (This) ' value= ' delete '/> ';
count++;
}
Function del (BTN) {
var tr = btn.parentElement.parentElement;
var tbl = tr.parentelement;
if (Tr.rowindex >= 1) {
tbl.deleterow (tr.rowindex);
} else {
}
};