标签:
现在TD是HTMLTableCellElement,TD.outerHtml = <td class="current highlight">C2</td>
我要往td里添加一个div
<td class="current highlight">C2
<div id="remmem">
This is a newcon
</div>
</td>
一:
var newNode = document.createElement("div");
newNode.id = "remmem";
newNode.innerHTML =" This is a newcon ";
newNode.style.color = "red";
二:
TD.appendChild(newNode);
效果:<td class="current highlight">C3<div id="remmem">This is a newcon </div></td>
标签:
原文地址:http://www.cnblogs.com/lonely-buffoon/p/5983223.html