Sent by Saila, Craig on 20 August 2002 19:07
> -----Original Message-----
> From: Chris Smith [EMAIL-REMOVED]]
> Sent: August 20, 2002 1:30 PM
> I'm trying to hide several objects on a page using
> display: none. In order to find all the items I want
> to hide I'm using getElementsByName. It works great in
Maybe because DIV doesn't have the attribute of name...
This script should work based on your code (although you may want to
apply an ID to the containing table to narrow the node list collected by
"nObj"):
function toggleFields(show,hide){
var nObj = document.getElementsByTagName("div");
for(var i = 0; i < nObj.length; ++i) {
if(nObj[i].className==hide) nObj[i].style.display =
"none";
else if(nObj[i].className==show) nObj[i].style.display =
"block";
}
}
--
Cheers,
Craig Saila
------------------------------------------
[EMAIL-REMOVED] : http://www.saila.com/
------------------------------------------