<script>
function show()
{
var a2=document.getElementById("div2");
if(a2.style.display=="block")
{
a2.style.display="none";
}
else
{
a2.style.display="block";
} }
</script>
<input type="button" value="显示/隐藏" onclick="show()"/>
<div id="div2">你好啊</div>