Hi, I’ve got some javascript code. It works perfectly in Firefox but not in Internet Explorer where I get a “Object Expected” error message on the line with the link. The funcion closes every div with the class name of “class” and opens a div with the id “id”. Here is the code:
Function (I’ve got the function getElementsByClass in my common.js):
[CODE]function toggle(id,class) {
var a = getElementsByClass(class);
for(var i=0;i<a.length;i++) {
a[i].style.display=’none’;
}
var b = document.getElementById(id);
if(b.style.display == ‘block’)
b.style.display = ‘none’;
else
b.style.display = ‘block’;
}
And here is the call, I’ve tried both these versions:
[CODE]<a href=”javascript: toggle(‘divSubSub7’, ‘divSubSub’);”>SubSub7</a>
<a href=”#” onclick=”toggle(‘divSubSub7’, ‘divSubSub’); return false”>SubSub7</a>
Anyone know what I’m doing wrong? Thanks in advance!
Alfred