[Javascript] Hide show a TD

Chris T christ at saeweb.com
Mon Jun 21 13:06:33 CDT 2004


> I though of that,  my js knowledge came from actionscript, and in
> flash if you have any object name started with a number it will simply
> do not work
>
> but I've tested it here, and it worked ok, it's only 4 itens also, I
> will try my luck this time :)
>
> Chris, also I didn't get the advantage of doing this:
>
> var objEl = document.getElementById(id)
> objEl.style.display = "whatever you want"
>
> it will only be called once before the loop, next time it will replace
> itself, something I should know here ?
>
> I think you thought that I'm using the same element inside the
> looping, but I'm calling :
>
> document.getElementById(i) //only i not id

This is what I responded with earlier when someone asked something similar:
------------------------

Good technique is not always the most efficient in short scripts, but if you
emphasize it all the time, it will come natural to you and will help out
greatly in larger projects.

So "trying your luck this time" is fine if that's what you're looking for. I
thought maybe you'd want to learn something about the language.




More information about the Javascript mailing list