Page is a not externally linkable
- Code, Content, and Presentation
-- JavaScript and AJAX
---- Hide and Display Div


matthewamzn - 1:19 am on Mar 11, 2009 (gmt 0)


I can't get that to work either:

<script>
function displayAnswer($id) {
var el = document.getElementById($id);
if ( el.style.display === "none") { el.style.display = "block" ); }
else { el.style.display = "none"); }
}
</script>
<a href="javascript:displayAnswer(2);">Some Question?</a><br/>
<div id="2" style="display:none;">Some Answer<br/></div>


Thread source:: http://www.webmasterworld.com/javascript/3867396.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com