2012/09/16

顯示或隱藏內容


html page element display or hidden


<script type="text/javascript">
function hideshow(which){
if (!document.getElementById)
return
if (which.style.display=="block")
which.style.display="none"
else
which.style.display="block"
}
</script>
<a href="javascript:hideshow(document.getElementById('adiv'))">11111</a><br><br>
<div id="adiv" style="font:24px bold; display: none">111111111</div>
<a href="javascript:hideshow(document.getElementById('adiv2'))">22222 </a><br><br>
<div id="adiv2" style="font:24px bold; display: none">222222222e</div>
<a href="javascript:hideshow(document.getElementById('adiv3'))">33333 </a><br><br>
<div id="adiv3" style="font:24px bold; display: none">3333333333333e</div>

沒有留言:

張貼留言