<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<style>
div{ 200px; height:100px; border:1px #999999 solid; margin-top:10px;}
</style>
<script>
function sw(){
var divid=document.getElementById('box2');
if(divid.style.display=='none'){
divid.style.display='block'
}else{
divid.style.display='none'
};
};
</script>
</head>
<body>
<div id="box1"><button onClick="sw()">显示、隐藏</button></div>
<div id="box2" style="display:none;"></div>
</body>
</html>