function hideDivWithClasses(theClass) { //Populate the array with all the page tags var allPageTags=document.getElementsByTagName("div"); //Cycle through the tags using a for loop for (i=0; i//Pick out the tags with our class name if (allPageTags[i].className==theClass) { //Manipulate this in whatever way you want allPageTags[i].style.display='none'; } } } =============================