当前位置: 代码迷 >> JavaScript >> 显示或不显示 表格中的某一行。这么做为什么不行?IE6 中解决思路
  详细解决方案

显示或不显示 表格中的某一行。这么做为什么不行?IE6 中解决思路

热度:2   发布时间:2012-03-15 11:50:38.0
显示或不显示 表格中的某一行。这么做为什么不行??IE6 中
<table   width= "100% "   border= "1 ">
    <tr>  
        <td> 111111111 </td>
    </tr>
    <span   id=my>
    <tr>
        <td> 显示或不显示这行 </td>
    </tr>
    </span>
    <tr>  
        <td> 33333333 </td>
    </tr>
</table>
<input   type=checkbox   onclick= "p(this.checked) "> 显示   或   不显示   第2行
<script>
function   p(b)
{
if(b==true)
document.getElementById( 'my ').style.display= "block ";
else
document.getElementById( "my ").style.display= "none ";
}
</script>


------解决方案--------------------
你这样加HTML是非法的

<tr id=my>
<td> 显示或不显示这行 </td>
</tr>
  相关解决方案