I have this HTML:
Intermediate steps →
Try this code
document.querySelector('.staticStep :nth-child(i)').src = images[num][i]; where i = 0,1,2,--- ,n.