I\'ll get right to it:
What I need to do is hide a particular div with the press of a button, and it\'s supposed to be a toggle, so basically: Press once to hide, pr
You can make use an onclick method. Have your HTML as:
I want to hide this by pressing the button above
And have the following JavaScript:
function toggle_visibility(id)
{
var e = document.getElementById(id);
if (e.style.display == 'block' || e.style.display=='')
{
e.style.display = 'none';
}
else
{
e.style.display = 'block';
}
}
DEMO