Web Analytics Made Easy -
StatCounter dinamically hidding html - CodingForum

Announcement

Collapse
No announcement yet.

dinamically hidding html

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • dinamically hidding html

    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

  • #2
    Are you talking about dynamically expanding and collapsing portions of your page???
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

    Comment


    • #3
      <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>

      Comment


      • #4
        For NS4, you will have to use layers..

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

        <layer id="layerName">........</layer>
        Scripting | JavaScripts | PerlScripts | Python Scripts | Articles | My Journal

        Comment

        Working...
        X