var elem=document.getElementsByClass('className'); for (var i=0; i