function AddRow(obj)
{
var btn=obj;
while(obj.tagName!='TABLE')
{
obj=obj.parentElement;
}
var loop=obj.rows.length;
obj.insertRow(loop).insertCell().innerHTML="工种代码:<input style='ime-mode:disabled ' name='txtno' type='text' id='txtno' size='10' maxlength='3'>";
var str="工种名称:<input name='txtname' type='text' id='txtname' size='25'>";
obj.rows[loop].insertCell(1).innerHTML = str;
obj.rows[loop].cells[1].insertAdjacentElement("beforeEnd",btn);
}
说明:obj为表格内动态增加行的按钮对象