<script type="text/javascript">
<!--
function toggle_visibility(id) {
var e = document.getElementById(id);
if(e.style.display == 'block')
e.style.display = 'none';
else
e.style.display = 'block';
}
//-->
</script>
==============================HTML============================
<div class="test" onclick="toggle_visibility('testId');" >Click Me</div>
<div id="
testId">
Demo text
</div>