var elems = getElementsByClass("class"); for (var i = 0; i < elems.length; i++) elems[i].style.display = "...";