Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started