let counter = 0;
function change() {
if (counter < results.length) document.getElementById("container").style.backgroundImage = `url(static/letters/${results[counter++]}.jpg)`;
}
window.onload = function() {
setInterval(change, 2000);
};
I am seeking a way for this change to occur only once until all the images are displayed. After that, I would like the container to be empty. Can you help identify any errors in my code?