js单双引号的问题,大侠相助啊!
代码如下:<script LANGUAGE="JavaScript">
var Clinum = 1;
function newRow()
{
var row= tbl.insertRow(-1); //添加行
row.height="28"; //设置行高
var cell1 = row.insertCell(0); //添加列
var cell2 = row.insertCell(1); //添加列
var cell3 = row.insertCell(2);
var cell4 = row.insertCell(3);
var cell5 = row.insertCell(4);
cell1.innerHTML="<center>"+""+"</center>";
cell2.innerHTML="<center>"+""+""+""+""+"</center>";
cell3.innerHTML="<center>"+""+"</center>";
cell4.innerHTML=" ";
cell5.innerHTML="<input type='button' name='button1' id='button1' value='删除' onclick='deleteRow('tbl',this.parentElement.rowIndex)' />"
}
function deleteRow (tableID,rowIndex)
{
var table = document.all[tableID];
table.deleteRow(rowIndex);
}
</script>
<body>里面是个名叫tbl能动态添加行的表格,红色代码是让它也能动态删除本行,调试说是语法错误,红色代码有问题。跪求高见!