If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

You can. I suspect your problem is that you are invoking this function BEFORE the DOM is fully loaded, or you have a typo so that the id of the element you are trying to access is not the id you have actually given it.

The JavaScript snippet you provided would work, so the issue is with the rest of the code you're not showing. If there is an error, other than a logical one, check the error console, such as through Chrome. If there are no error messages in there whatsoever, then can you provide more of the file?

If I can, can you explain why doesn't this function call work, throwing the error: "Uncaught TypeError: Cannot set property 'visibility' of undefined." It seems that JS doesn't pass the type as a DOM ELEMENT when it passes the object.

How do I define the DOM ELEMENT type for this function call? I don't understand why the following aren't functionally equivalent and how to fix it. I've included the fully function "standard" way of doing it in the code below. Can you explain this?