var noo = 2;
function addLine()
{
noo = noo + 1;
var table = document.getElementById("table");
var newLine = document.createElement("tr");
var xh = document.createElement("td");
var xm = document.createElement("td");
var del = document.createElement("td");
xh.innerHTML = "xh00"+noo;
xm.innerHTML = "姓名";
del.innerHTML="<a href='javascript:;' onclick='del(this)' >删除</a>";
newLine.appendChild(xh);
newLine.appendChild(xm);
newLine.appendChild(del);
table.appendChild(newLine);
}
浏览器开发者工具下查看的,错误自己看