use forEach instead of forloop for HTMLCollections