功能实现:点击添加按钮,表格增加一行并给其name属性赋予的值,方便获取
JQuery中定义一个count变量
var e_id = tr.insertCell(0);
e_id.innerHTML = '';
e_id.innerHTML = '';
var class_id = tr.insertCell(1);
class_id.innerHTML = '';
var memo = tr.insertCell(2);
memo.innerHTML = '';
var del = tr.insertCell(3);
del.innerHTML = '';
count++;
}
function del(btn) {
var tr = btn.parentElement.parentElement;
var tbl = tr.parentElement;
if (tr.rowIndex >= 1) {
tbl.deleteRow(tr.rowIndex);
} else {
}
};