<select id="selChengji" onchange='fuzhi(this);'>=====================
function fuzhi(obj){
alert(obj.parentNode.lastChild.value);
.........
}

解决方案 »

  1.   

    不知道为什么我这么写不对啊 。。<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档</title>
    <script language="javascript1.3">
    function fuzhi()
    {
    var a=event.srcElement.parentElement.lastChild;
    alert(a.value);
    }
    </script>
    </head><body>
    <table border="1" width="100%">
    <tr>
    <td class="tb_td">
    <select id="selChengji" onchange='fuzhi();'>
                       <option value="1">合格</option>
                       <option value="0">不合格</option>
    </select>
    <input type="text" style="width: 25px;" id="txtStatus" />
    </td>
    </tr>
    </table>
    </body>
    </html>谁解释一下?
      

  2.   

    为什么你的不对,你为有空格,空格也是节点,是文本节点,所以,要想你的起作用,应当这样
    </select><input type="text" style="width: 25px;" id="txtStatus" /></td>
      

  3.   

    虽然楼上那种方法可以,但我觉得用lastChild方法不大好。我的做法是:
    function getLast(obj)
    {
       var nodes = obj.parentNode.getElementsByTagName("input");
       for(var i=0; i < nodes.length; i++)
       {
           var node = nodes[i];
           if(node.id == "txtStatus")
           {
               alert("finded!");
           }
       }
    }