How to collapse a DIV - Javascript - HTML
Jun 6th, 2007 by Onyrix 553 Views |
Email This Post
|
Print This Post
Suppose you have a block of text you want to be collapsible clicking a link.
Here is the code:
<script language=”javascript”>
function switchDiv(id_div)
{
if(document.getElementById(id_div).style.display == ‘none’)
{
document.getElementById(id_div).style.display = ‘block’;
}
else
{
document.getElementById(id_div).style.display = ‘none’;
}
}
</script>

del.icio.us
Digg
Furl
Reddit
Technorati