From 2a2e77b34acc8d940aa1f1835d4a7c46c02547eb Mon Sep 17 00:00:00 2001 From: leekoby Date: Thu, 5 Jan 2023 15:11:20 +0900 Subject: [PATCH] Rainbow Text Exercise --- 56_Rainbow Text Exercise/app.js | 9 +++++++++ 56_Rainbow Text Exercise/index.html | 24 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 56_Rainbow Text Exercise/app.js create mode 100644 56_Rainbow Text Exercise/index.html diff --git a/56_Rainbow Text Exercise/app.js b/56_Rainbow Text Exercise/app.js new file mode 100644 index 0000000..0b310fe --- /dev/null +++ b/56_Rainbow Text Exercise/app.js @@ -0,0 +1,9 @@ +const colors = ['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet']; //PLEASE DON'T CHANGE THIS LINE! + +//YOU CODE GOES HERE: +const singleLetters = document.querySelectorAll('span'); +let color = 0; +for (let singleLetter of singleLetters) { + singleLetter.style.color = colors[color]; + color++; +} diff --git a/56_Rainbow Text Exercise/index.html b/56_Rainbow Text Exercise/index.html new file mode 100644 index 0000000..0cd9751 --- /dev/null +++ b/56_Rainbow Text Exercise/index.html @@ -0,0 +1,24 @@ + + + + Rainbow + + + + + + + + +

+ R + A + I + N + B + O + W +

+ + + \ No newline at end of file