日期:2014-05-17 浏览次数:20631 次
<table width="600" border="0" cellpadding="0" cellspacing="0" class="solid-bottom">
<tr>
<td width="600" height="20">
<table border="0" cellpadding="0" cellspacing="0" id="secTable">
<tr>
<td height="25" width="60" align="center" class="sec2" onclick="secBoard(0)">分钟</td>
<td width="60" align="center" class="sec1" onclick="secBoard(1)">小时</td>
<td width="60" align="center" class="sec1" onclick="secBoard(2)">天</td>
<td width="60" align="center" class="sec1" onclick="secBoard(3)">月</td>
<td width="60" align="center" class="sec1" onclick="secBoard(4)">周</td>
<td width="60" align="center" class="sec1" onclick="secBoard(5)">开始结束</td>
<td width="60" align="center" class="sec1" onclick="secBoard(6)">验证</td>
</tr>
</table>
</td>
<td width="20">
<script language="JavaScript" type="text/javascript">
function secBoard(n)
{
for(i=0;i<secTable.cells.length;i++)
secTable.cells[i].className="sec1";
secTable.cells[n].className="sec2";
for(i=0;i<mainTable.tBodies.length;i++)
mainTable.tBodies[i].style.display="none";
mainTable.tBodies[n].style.display="block";
}
</script>
</td>
</tr>
</table>
var secTable = document.getElementById('table');
function secBoard(n) {
//table的设计是table.rows.cells,而不是table.cells,table.cells是设计是IE独有的
//测试了一下甚至IE6都没有table.cells
alert(secTable.rows[0].cells.length);
//后面的table.cells都是undefined异常
for (i = 0; i < secTable.cells.length; i++)
&nbs