You are here: irt.org | FAQ | DHTML | Q984 [ previous next ]
Try:
<script language="JavaScript"><!--
var toggle = false;
function show(object) {
if (document.layers && document.layers[object])
document.layers[object].visibility = 'visible';
else if (document.all) {
document.all[object].style.visibility = 'visible';
document.all[object].style.zIndex = 100;
}
}
function hide(object) {
if (document.layers && document.layers[object])
document.layers[object].visibility = 'hidden';
else if (document.all)
document.all[object].style.visibility = 'hidden';
}
//--></script>
<form>
<input type="button" onClick="if (toggle = !toggle) hide('myId');else show('myId')" value="Show/Hide">
</form>
<div id="myId" style="position: absolute; visibility: visible;">Test</div>