<SCRIPT>
function insertElement(obj)
{
var nod=document.createElement("TD");
obj.insertBefore(nod);
    nod.innerText="A New bold object has been inserted into the document."
}</SCRIPT>
<BODY>
<table width="600" border="1" cellspacing="0" cellpadding="0">
  <tr>
<td  onclick ="insertElement(this)">点这里加入一行。</td>
  </tr>
</table>
</body>

解决方案 »

  1.   

    <table>
      <tr>
    <td onclick="this.innerHTML+=' <INPUT TYPE=button value=click>'">点这里加个东东</td>
      </tr>
    </table>
      

  2.   

    function addTrafficeRow() //增加一行
    {
        newRow=trafficeList.insertRow(trafficeList.rows.length);
        newRow.id="tradt";
        newRow.ln=allTrafficCount;
        
        c1=newRow.insertCell(0);
        c1.id="tradtRow";
        c1.ln=allCount;
        c1.innerHTML="<td><input type=text name='traffic' size=40 ></td><td><input type=button value='删除' ln=" + allTrafficCount + " onclick='javascript:delTrafficeRow();'></td>"//这里的td起不了作用啊

        allTrafficCount++; 
        frm.trafficCount.value = allTrafficCount;为什么在c1.innerHTML中加入<td>就起不了作用啊??