ตัวอย่าง javascript สลับ ซ่อน แล้ว แสดง โดยใช้ div style value
<script>
function swap(){
var str =document.getElementById('div1').style.display ;
//alert(str);
if(str=="none"){
document.getElementById('div1').style.display='';
}else{
document.getElementById('div1').style.display='none';
}
}
</script>
<a href="javascript:swap();">Click<a><BR>
<div id="div1" style="display:none">
xxxxxx xxxxxx
</div>
ตามนั้นเลยครับใช้ div set ค่า style ในการซ่อนหรือ แสดง