//Hide all by element id elementCount = document.all("XYZ123").length; for (i=0; i<elementCount; i++) { document.all("XYZ123",i).style.display='none' }