Hello. I’m working my way through a Udemy course and this assignment wants me to iterate over a list of spans using a loop. Here is the assignment explanation:
And here is one of the loops I tried. I think I’m grabbing the source wring. But there are different ways to loop over this. But I also think I have a good start or base.
There are 7 elements (colors) in the colors array. There are also 7 span elements that will be in the node list you create with querySelectorAll. You should be able to use the corresponding indices of each array to get the desired result.
Can you post your latest code attempt? To you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.