日期:2014-05-18  浏览次数:20659 次

简单的关于 table中this.parentElement 的问题
<html>
<head> </head>
<body>
<form       name= "a ">      
<table   name= "b ">      
<tr   name= "c "   >      
                                <td   name= "d "   >      
                                            <select     name= "e "     onchange= "xx(this.parentElement.parentElement.parentElement.name) ">
    <option   > 1 </option>
    <option   > 2 </option>
    <option   > 3 </option>
    <option   > 4 </option>

    </select>
                                </td>    
<td> &nbsp; </td>
                                 
                    </tr>      
    <tr> &nbsp; </tr>
            </table>      
    </form>  
  </body>
  <script   language= "javascript ">
  function   xx(a)
  {
      alert(a);
  }
  </script>
</html>
//输出undefined   为什么了?   不是应该输出b么?

------解决方案--------------------
<table>
<tbody>
<tr>
<td>