Question: Having a hard time to get this one right Rainbow Text Exercise I've provided you with an element which contains 7 individual spans (each holding

Having a hard time to get this one right
Having a hard time to get this one right Rainbow Text Exercise

Rainbow Text Exercise I've provided you with an

element which contains 7 individual spans (each holding a single letter). Please write some JavaScript to make them rainbow-colored! In app.js you'll find an array of color names called colors. It looks like: l'red', 'orange, "yellow', 'green', 'blue', 'indigo', 'violet'll Your task is to select all spans, iterate over them, and assign them each one of the colors from the colors array, The first span should be red, the second should be orange, etc. Your result should look like this: RAINBOW index.html app.js 5 1 const colors - ['red', 'orange, yellow, green, 'blue', 'Indigo', 'violet'] 2 3 / YOU CODE GOES HERE: 4 for Clet color of colors) { return color; 6) 08 const spanAll document.querySelectorall span) 9. for(let span of spanAll){ 10 Span+color 11 span style, textColor"colors 12} 7

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!