想做个登录框,为什么不行呀!求解答
<!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-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>登录框</title>
</head>
<style>
*{margin:0;padding:0}
#div1{position: absolute;
width:100%;
height:100%;
background:#999;
opactiy:0;
filter:Alpha(opacity=0);
display:none;
z-index:1000;
}
#div3{width:250px;
height:150px;
background:#39F;
position:absolute;
top:200px;
left:40%;
display:none;
z-index:1001;
}
</style>
<script>
function(){
var oDiv1=document.getElementById("div1");
var oBtt=document.getElementById("button");
var oDiv3=document.getElementById("div3");
oBtt.onclick=function(){
oDiv1.style.display="block";
oDiv3.style.display="block";}
}
</script>
<body>
<div id="div1">
</div>
<div id="div2">
<input id="button" type="button" value="登陆" />
</div>
<div id="div3">
</div>
</body>
</html>