如何实现多个div的显示与隐藏 谢谢!!

来源:百度知道 编辑:UC知道 时间:2024/06/09 19:38:40
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<script langauge="javaScript" type="text/javascript">
<!--
function showDiv(i)
{
for(j=0;j<=6;j++)
{
document.all.(div+j).style.display="none";

}
document.all.(div+i).style.display="block" ;
}

--//>
</script>
</head>

<body ><form>
<table width="700" border="1" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2&

改好了

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<script langauge="javaScript" type="text/javascript">

function showDiv(i)
{
for(j=0;j<=6;j++)
{
document.getElementById('div'+j).style.display='none';

}
document.getElementById('div'+i).style.display='block';
}

</script>
</head>

<body ><form>
<table width="700" border="1" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td width="169" height="283"><table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr>