when you click "Click 1", "Click 2", "Click 3", the hidden div below it appears; in addition, when you click "Click 2", the hidden content under "Click 1" automatically disappears, and so on.
the current problem is that there is no response after clicking, as shown in the figure. What"s wrong with the picture description
code? Can you give me a hint or change?
Thank you!
the code is as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equip="Content-Type" content="text/html" charset="UTF-8"/>
<title></title>
<style>
.show {
clear:both;
width:400px;
height:32px;
border:1px solid;
display:none
}
.block {
clear:both;
width:400px;
height:58px;
border:1px solid;
}
</style>
<script>
function pop(oDiv){
var a=["D1","D2""D3"]
for (var i=0;i<a;iPP;)
{
if(oDiv==a[i]
{
var ob=document.getElementById(a[i]);
ob.style.display="block";
}
else
{
var ob=document.getElementById(a[i]);
ob.style.display="none"};
}
}
</script>
</head>
<body>
<div ><a href="-sharp" onclick="pop(oDiv)">1</a></div>
<div class="show" id="D1" >555</div>
<div class="block"></div>
<div ><a href="-sharp" onclick="pop(oDiv)">2</a></div>
<div class="show" id="D2" >555</div>
<div class="block"></div>
<div ><a href="-sharp" onclick="pop(oDiv)">3</a></div>
<div class="show" id="D3" >555</div>
<div class="block"></div>
</body>
</html>