计算出表格中有几行是显示的,几行是隐藏的
2009-07-15 14:27:14| 分类:
IT
| 标签:
|举报
|字号大中小 订阅
<html>
<head>
<title>无标题文档</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--
function window_onload() {
var x=0;
for (i=0;i<window.test.rows.length;i++){
if (window.test.rows[i].style.display=="none")
x+=1;
}
alert("表test隐藏的行数:"+x+";显示行数:"+(i-x));
}
//-->
</SCRIPT>
</head>
<body bgcolor="#FFFFFF" text="#000000" LANGUAGE=javascript onload="return window_onload()">
<form name="form1" method="post" action="">
<table width="100%" border="1" id="test">
<tr style="display:block">
<td>第一行</td>
</tr>
<tr style="display:block">
<td>第二行</td>
</tr>
<tr style="display:block">
<td>第三行</td>
</tr>
<tr style="display:none">
<td>第四行</td>
</tr>
<tr style="display:none">
<td>第五行</td>
</tr>
</table>
</form>
</body>
</html>
评论这张
转发至微博
转发至微博
评论