Your code is just overwriting the same container innerHTML every time through the loop. It sounds like you’re expecting that it would add new text or elements each time.
If you want to add new text, try appending to container.innerHTML instead of overwriting it each time:
container.innerHTML += movie.title + " is a great movie"
Notice +=
instead of =
. This probably also isn’t going to render the way you expect, but you should at least see all the movie titles jammed together in a single element.
Since you’re using a database listener that’s going to get invoked every time something in the collection changes, you should also consider wiping out what’s in that container instead of blindly appending to it each time:
movies.onSnashot( snap => {
container.innerHTML = ""
for(const movie of snap.docs) {
const id = movie.id;
const data = movie.data();
container.innerHTML += movie.title + " is a great movie"
}
})