var table = document.getElementById("table1");
var tr = table.insertRow();
var td = tr.insertCell();
td.innerHTML= document.getElementById('txt1').value;
Run Code Online (Sandbox Code Playgroud)
我正在使用这样的代码.如何为tr(TableRow)提供Id.帮我.
因为你使用标准的Javascript,你必须使用该功能setAttribute("align", "center", 0);
.
试试以下:
tr.setAttribute("id", "myIdNameforThisRow", 0);
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
35863 次 |
最近记录: |