javascript显示隐藏表格的行

 

代码
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script>
function Button2_onclick() {//显示和隐藏表格的行;
      if (tr1.style.display == "") {
          tr1.style.display 
= "none";
      } 
else {
          tr1.style.display 
= "";
      }
  }
</script>
</head>

<body>
<form id="form1" name="form1" method="post" action="">
  
<input   type=button   value='显示'   onclick='javascript:Button2_onclick()'>   
  
<table   border=1>   
  
<tr><td>sdfsdf</td></tr>   
  
<tr   id=tr1   style='display:none'><td>sdfsd</td></tr>   
  
</table>


</form>
</body>
</html>

 

posted on 2009-11-28 10:31  奥尔格勒  阅读(1705)  评论(0编辑  收藏  举报