Hoggle
01-20-2005, 10:58 PM
I am trying to use the function below in a tree-menu to toggle the visibility of child buttons via their style object. However, even though I get a list of divs back, all of which test OK as HTMLDivElement objects, I get an error in IE6 (SP2) whenever I try to access any of the properties (even length and toString() ) saying the property is not supported.
It all works fins in Opera and Mozilla.
Code:
var list = document.getElementsByTagName('div');
for(a=0; a<list.length; a++)
if(HTMLDivElement.prototype.isPrototypeOf(list.a))
alert(list.a.className); // Falls over here
else alert('list.'+a+' is NOT an HTMLDivElement type object');
Any ideas?
It all works fins in Opera and Mozilla.
Code:
var list = document.getElementsByTagName('div');
for(a=0; a<list.length; a++)
if(HTMLDivElement.prototype.isPrototypeOf(list.a))
alert(list.a.className); // Falls over here
else alert('list.'+a+' is NOT an HTMLDivElement type object');
Any ideas?