If you already have an answer your happy with ignore this but otherwise it might help.<br><br>function toggleDisplay(id) {<br> var el = document.getElementById(id);<br> if(el.className == 'hidden') {<br> el.className
= '';<br> } else {<br> el.className = 'hidden';<br> }<br>}<br><br><div id='toHide'>My div content</div><br><a href='#' onclick="toggleDisplay('toHide'); return false;">Toggle display</a>
<br><br>You might want to perform a better check than just looking for an exact match on the className, like prototype's Element.hasClassName but this is just a quick sample to get you started.<br><br><br>