<select onchange="t.rows[selectedIndex].style.display='none'">
<option>1</option>
<option>2</option>
<option>3</option>
</select>
<table border="1" width="100%" id=t>
  <tr>
    <td width="100%">1</td>
  </tr>
  <tr>
    <td width="100%">2</td>
  </tr>
  <tr>
    <td width="100%">3</td>
  </tr>
</table>

解决方案 »

  1.   

    我写的函数:
      function OnChange()
      {
         MyTable.rows[selectedIndex].style.display="none";
      }
    <select onchange="OnChange();">可是,提示错误,怎么回事?师兄,再帮帮我!
      

  2.   

    <html>
    <head>
    <title>表格行的隐藏和显示</title>
    <script language=javascript>
    function tableHidden()
    {
    var iIndex=document.all.seChange.selectedIndex;
    document.all.tbView.rows[iIndex].style.display='none';
    }
    </script>
    </head>
    <body>
    <select onchange="javascript:tableHidden()" id="seChange">
    <option>1</option>
    <option>2</option>
    <option>3</option>
    </select>
    <table border="0" width="100%" id="tbView">
    <tr>
    <td width="100%">1</td>
    </tr>
    <tr>
    <td width="100%">2</td>
    </tr>
    <tr>
    <td width="100%">3</td>
    </tr>
    </table>
    </body>
    </html>