代码如下:
<html>
<head>
<meta httpequiv="ContentType" content="text/html; charset=gb" />
<title>oec</title>
<script language="JavaScript" type="text/JavaScript">
<!
function toggle(targetid){
if (documentgetElementById){
target=documentgetElementById(targetid);
if (targetstyledisplay=="block"){
targetstyledisplay="none";
} else {
targetstyledisplay="block";
}
}
}
>
</script>
<style type="text/css">
<!
#div{
backgroundcolor:#;
height:px;
width:px;
display:none;
}
>
</style>
</head>
<body>
<input type="button" id="butn" value="显示/隐藏" onclick="toggle(div)" />
<center>
<div id="div"></div></center>
居中的DIV
</body>
</html>