<table border='1' id='output'>
<tr>
<td>
</td>
</tr>
</table>
我的 JavaScript 代码
document.getElementById("output").childNodes[0].childNodes[0].nodeValue = ajaxRequest.responseText;
不起作用,请帮忙
最佳答案
使用 JQuery 你可以轻松做到这一点,如下所示:
$(document).ready(function(){
$("#output tr td").text("JQUERY HELP");
});
或者如果您想继续使用 javascript,您可以引用其他发布的答案。
关于javascript 将数据添加到表格单元格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5645139/