function add1()
{
    document.getElementById("xianshi").firstChild.firstChild.innerHTML = "你是好人";
}

解决方案 »

  1.   

    function add1()
    {
    document.getElementById("xianshi").childNodes[0].childNodes[0].childNodes[0].innerHTML="123"
    }
      

  2.   

    回复EricGuzuqiang()  你的我试了下 出现运行未知错误
    回复mingxuan3000(铭轩)  你的出现childNodes[0] 为空或不是对象
    还是不行啊!在帮我想想办法吧!
      

  3.   

    <table id="xianshi">
    <tr><td></td></tr>  //你table差个td
    </table>
      

  4.   

    <script>
    function add1()
    {
        document.getElementById("mId").innerHTML = document.getElementById("mSel").value;
      
    }
    </script>
    <select  id="mSel" name="name2" onchange="add1();">
    <option value="好人">好人</option>
    <option value="坏人">坏人</option></select><table id="xianshi">
    <tr>
    <td id="mId" name="mId></td>
    </tr>
    </table>