...

View Full Version : dinamically hidding html



alx
07-06-2002, 07:31 PM
hello,

how can i hide html on the fly?

i'm trying to do that as following:

<script language="JavaScript">
var hide_html = true
if(hide_html) document.write('<!--')
</script>
<table>
<tr><td>box a</td></tr>
</table>
<script language="JavaScript">if(hide_html) document.write('-->')</script>

but it doesn't work.

the problem is escaping comments character,

thanks in advance

Vladdy
07-06-2002, 07:41 PM
Are you talking about dynamically expanding and collapsing portions of your page???

Bosko
07-06-2002, 07:45 PM
<table id="blah">
<tr><td>box a</td></tr>
</table>

<script>
var x=document.getElementById("blah");
x.style.visibility="hidden";
</script>

or:

<script>
var x=document.getElementById("blah");
x.style.display="none";
</script>

premshree
07-06-2002, 08:57 PM
For NS4, you will have to use layers..

<script>
document.layerName.document.write('');
document.layerName.document.close();
</script>

<layer id="layerName">........</layer>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum