Results 1 to 2 of 2

Thread: [RESOLVED] [Javascript] Element not disappearing as expected.

  1. #1

    Thread Starter
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Resolved [RESOLVED] [Javascript] Element not disappearing as expected.

    Howdy all,

    I was wondering.. with the below code.. why the table's cell data doesn't disappear as I would expect it to?
    Code:
    function HideTables()
    {
    	var divtags = document.getElementsByTagName("div");
    	for (i=0;i<num_Tabs;++i) {
    		var tables = divtags[i].getAttribute("tabletag");
    		if (tables=="table") {}
    		divtags[i].style.display="none";
    	}
    }
    Code:
    <div id="HomeTable" tabletag="table">
    This text should disappear.. ?!?!?!?!?!
    </div>
    Clearly I'm not meant for web design..

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

  2. #2

    Thread Starter
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: [Javascript] Element not disappearing as expected.

    Yeah.. dw, I'm completely stupid.

    I was using num_Tabs for some stupid reason.. with so many <div> tags in my page, and only 4 tabs (num_Tabs=4), I never reached the table I wanted to disappear!

    Thanks anyway!

    chem

    Visual Studio 6, Visual Studio.NET 2005, MASM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width