用childNodest1.rows[0].cells[0].childNodes[0].name
获取一行一列第一个字对象的name

解决方案 »

  1.   

    <script>
    function Insert(){
    var oImg = document.createElement("<img id=pic src=''>");var oChk = document.createElement("<input id=chk type=checkbox>");tab1.rows[0].cells[0].appendChild(oImg);tab1.rows[0].cells[0].appendChild(oChk);
    }function getName(){
    alert(tab1.rows[0].cells[0].firstChild.nextSibling.id);
    }
    </script><table id=tab1 border=1 width=200>
      <tr>
        <td>
        </td>
      </tr>
      <tr>
        <td>
        </td>
      </tr>
    </table>
    <input type=button value="insert" onclick="Insert()" id=button1 name=button1>
    <input type=button value="getname" onclick="getName()">结贴吧
      

  2.   

    特别感谢 yjgx007(谁是高手),太费心了,谢谢.