为什么这样的innerText没有效果?
<table border="0" cellpadding="0" cellspacing="0" id="t">
<tr>
<td width="345">lsk</td>
</tr>
</table>
<script language="javascript">
alert(document.getElementById("t").innerText);//这个时候innerText是lsk
document.getElementById("t").innerText +="fb";
alert(document.getElementById("t").innerText);//这个时候innerText是lskfb,但是表格不见了!
</script>
document.getElementById("t").innerText +="fb";//执行完这句后表格中的所有内容都不见了!
alert(document.getElementById("t").innerText);//用这句可以看出实际上他的innerText是lskfb也就是说innerText变了但是表格没了! 怎么回事?
我正在做一个项目需要在表格(<table id="t"></table>)中插入:<tr><td>xx</td><tr>这样的代码但是没效果!