quote:
Originally posted by wj
That half works, It starts out hidden, but it doesnt re-hide....
It wont rehide because of this line
quote:
Originally posted by wj
document.getelementbyid('spoiler').style.visibility = 'hidden';
Javascript is case sensitive. I fixed the code and this works.
code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<script language="javascript">
function hideshow(){
if(document.getElementById('spoiler').style.display == 'none'){
document.getElementById('spoiler').style.display = '';
} else {
document.getElementById('spoiler').style.display = 'none';
}
}
</script>
</HEAD>
<BODY>
<a href="#" OnClick="hideshow()">Spoilers (on/off)</a>
<div id="spoiler" style="display:none;">
Testing Testing Testing Testing Testing Testing Testing Testing Testing Testing Testing Testing Testing Testing Testing Testing Testing Testing
</div>
</BODY>
</HTML>