From 222323e6ae7846a4895679f5f1bc3a90830ca169 Mon Sep 17 00:00:00 2001 From: mrafeie Date: Tue, 15 Sep 2026 20:55:22 +0100 Subject: [PATCH 1/2] Update title and structure of index.html --- Sprint-3/quote-generator/index.html | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Sprint-3/quote-generator/index.html b/Sprint-3/quote-generator/index.html index 30b434bcf..fdb8eb8f6 100644 --- a/Sprint-3/quote-generator/index.html +++ b/Sprint-3/quote-generator/index.html @@ -3,13 +3,21 @@ - Title here + + Quote generator app + + + -

hello there

-

-

- +
+

Quote Generator

+ +
+

+ + +
From f0e1a0daa92ffa7294b51b851fb30dba6555dc37 Mon Sep 17 00:00:00 2001 From: mrafeie Date: Tue, 15 Sep 2026 20:56:25 +0100 Subject: [PATCH 2/2] Implement random quote display functionality Added displayRandomQuote function to show a random quote and author on button click. --- Sprint-3/quote-generator/quotes.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index 4a4d04b72..bd29cf5d0 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -491,3 +491,19 @@ const quotes = [ ]; // call pickFromArray with the quotes array to check you get a random quote +function displayRandomQuote() { + const selectedQuote = pickFromArray(quotes); + + document.getElementById("quote").textContent = selectedQuote.quote; + document.getElementById("author").textContent = selectedQuote.author; +} + +function setup() { + const newQuoteButton = document.getElementById("new-quote"); + + newQuoteButton.addEventListener("click", displayRandomQuote); + + displayRandomQuote(); +} + +window.onload = setup;