Andrew Crook said:
I had several of the following defined
<div id="menu" class="menu0">
It is incorrect HTML (i.e., your document is not HTML, it just looks
vaguely like it).
the classes was different because CCS held positiion info, but ID's were the
same.
i could then use the following javascript
for (menuIdx=0;menuIdx<menu.length;menuIdx++)
{
menu[menuIdx].style.visibility = "hidden"
More than one element having the same ID is incorrect HTML. IE allows it
anyway, but that doesn't make it right, nor does it make it recommendable,
since other browsers might act differently.
Using the name of an element as a global variable is again an IE specific
behavior. Other browsers will fail on that line, even if only one element
had id="menu".
The correct way is:
document.getElementById("menu").style.visiblity = "hidden";
and only one element should be fetched (it's getElement, not getElement*s*)
menu.length seems to work fine
Seems? How? Work? how? Fine? (you get the point: Be more specific!)
menu was not defined in javascript and this worked perfectly, until i tried
to define the DIV's via document.write (now menu is not defined).
So you didn't show us the part of the code you changed when the problem
started.
I bet the problem is in that code.
/L