for(var i=0, m=item.length; i<m; i++){ item[i].style.background = 'rgb('+ getRand() +', '+ getRand() +', '+ getRand() +')'; }