I found a simple toggle script which opens and closes a div upon clicking the link. Is there a way for it to toggle without click the designated link.. or in other words, click anywhere on the page.


function toggle_visibility(id) {
var e = document.getElementById(id);
if(e.style.display == 'block')
e.style.display = 'none';
else
e.style.display = 'block';

}
onclick="toggle_visibility('idname');"
Thank you!