js对象的问题
[code=HTML][/code]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>index3.html</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="index3.css" type="text/css"></link>
<script language="javascript">
<!--
function Change(val){
if(val=="div1"){
window.alert("ok");
document.getElementById('div1').style.display='block';
document.getElementById('div2').style.display='none';
document.getElementById('div3').style.display='none';
document.getElementById('div4').style.display='none';
}else if(val=="div2"){
window.alert("ok2");
document.getElementById('div1').style.display='none';
document.getElementById('div2').style.display='block';
document.getElementById('div3').style.display='none';
document.getElementById('div4').style.display='none';
}else if(val=="div3"){
window.alert("ok3");
document.getElementById('div1').style.display='none';
document.getElementById('div2').style.display='none';
document.getElementById('div3').style.display='block';
document.getElementById('div4').style.display='none';
}else if(val=="div4"){
window.alert("ok4");
document.getElementById('div1').style.display='none';
document.getElementById('div2').style.display='none';
document.getElementById('div3').style.display='none';
document.getElementById('div4').style.display='block';
}
}
-->
</script>
</head>
<body>
<div class="top">
<div class="kehu"></div>
<div class="zhuti">sd</div>
<div class="anniu">
<ul>
<li onclick="Change('div1')"><a href="#"><img src="images/1.jpg" style="margin-left:5px" /></a></li>
<li onclick="Change('div2')"><a href="#"><img src="images/2.jpg" style="margin-left: 70px;margin-top: -60px;position: absolute;"/></a></li>
<li onclick="Change('div3')"><a href="#"><img src="images/3.jpg" style="margin-left:150px;margin-top: -60px;position:absolute;" /></a></li>
<li onclick="Change('div4')"><a href="#"><img src="images/4.jpg" style="margin-left:230px;margin-top: -60px;position:absolute;" /></a></li>
</ul>
</div>
<div class="div1" id="div1"></div>
<div class="div2" id="div1"></div>
<div class="div3" id="div1"></div>
<div class="div4" id="div1"></div>
</div>