japangreg
11-01-2002, 04:45 PM
Hey, everyone.
I have a javascript function that switched the display property for a series of DIVs on my page. This works in IE 6 and NS 7:
function toggle_folder(id){
var folderx = "folder" + id;
if (document.getElementById(id).style.display == "block"){
document.getElementById(id).style.display = "none";
document.getElementById(folderx).src="closed.gif";
}else{
document.getElementById(id).style.display = "block";
document.getElementById(folderx).src="open.gif";
}
}
My question is in regards to the IE 5.X DOM; does it support the getElementById method, or do I need to use the document.all? I am waiting for my sys admin to come by and modify my permissions so I can install IE 5 and test it, but I thought I'd ask here as well. So if anyone knows the answer to this, I'd appreciate the help!
Thanks!
japangreg
[to the mods: not sure if this belongs in the CSS or DOM forum. If it is posted incorrectly, I apologize and ask for you to please move it to the proper forum. Thanks!]
I have a javascript function that switched the display property for a series of DIVs on my page. This works in IE 6 and NS 7:
function toggle_folder(id){
var folderx = "folder" + id;
if (document.getElementById(id).style.display == "block"){
document.getElementById(id).style.display = "none";
document.getElementById(folderx).src="closed.gif";
}else{
document.getElementById(id).style.display = "block";
document.getElementById(folderx).src="open.gif";
}
}
My question is in regards to the IE 5.X DOM; does it support the getElementById method, or do I need to use the document.all? I am waiting for my sys admin to come by and modify my permissions so I can install IE 5 and test it, but I thought I'd ask here as well. So if anyone knows the answer to this, I'd appreciate the help!
Thanks!
japangreg
[to the mods: not sure if this belongs in the CSS or DOM forum. If it is posted incorrectly, I apologize and ask for you to please move it to the proper forum. Thanks!]