Answered step by step
Verified Expert Solution
Link Copied!

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
image text in transcribed
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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft SQL Server 2012 Unleashed

Authors: Ray Rankins, Paul Bertucci

1st Edition

0133408507, 9780133408508

More Books

Students also viewed these Databases questions

Question

3. Evaluate a Web-based training site.

Answered: 1 week ago