日期:2014-05-17 浏览次数:20396 次
function addRow() { i++; var tableObj = document.getElementById("mytable"); var newRowObj = tableObj.insertRow(tableObj.rows.length); var newColName = newRowObj.insertCell(newRowObj.cells.length); var newColAge = newRowObj.insertCell(newRowObj.cells.length); var newColButton = newRowObj.insertCell(newRowObj.cells.length); newColName.innerHTML = "<div class='label'> 产品名称:</div>"+ document.getElementById("TextBox1").value ; newColAge.innerHTML = "<input type='button' value='删除' onclick='deleteRow();' style=' position:relative; left:250px;' ><div class='label'> 产品版本:</div>" + document.getElementById("TextBox2").value; document.getElementById("TextBox1").value=""; document.getElementById("TextBox2").value=""; }