HTML <a href="javascript:void()" onclick="show()">點擊此處顯示或隱藏</a> <div id="hoary" style="display:none">可以隱身可以顯示。</div> JS <script type="text/javascript" ...
HTML
<a href="javascript:void()" onclick="show()">點擊此處顯示或隱藏</a>
<div id="hoary" style="display:none">可以隱身可以顯示。</div>
JS
<script type="text/javascript">
function show(){
document.getElementById("hoary").style.display=document.getElementById("hoary").style.display==''?'none':'';
}
</script>