From ba9667d4c1664f97e92c484442c4665370616f1e Mon Sep 17 00:00:00 2001 From: Jacknguyen4438 Date: Tue, 21 Apr 2026 15:30:56 +0100 Subject: [PATCH 1/2] Changing the title of HTML --- Sprint-3/quote-generator/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sprint-3/quote-generator/index.html b/Sprint-3/quote-generator/index.html index 30b434bcf..5f6a720f1 100644 --- a/Sprint-3/quote-generator/index.html +++ b/Sprint-3/quote-generator/index.html @@ -3,7 +3,7 @@ - Title here + Quote generator app From 8eb465253597a6eca55af9a0a8b656ef9c58ae59 Mon Sep 17 00:00:00 2001 From: Jacknguyen4438 Date: Tue, 21 Apr 2026 16:17:57 +0100 Subject: [PATCH 2/2] Writing the function that change to random quote with their author --- Sprint-3/quote-generator/quotes.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index 4a4d04b72..a2eb76715 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -491,3 +491,18 @@ const quotes = [ ]; // call pickFromArray with the quotes array to check you get a random quote + +function showRandomQuote() { + const randomQuote = pickFromArray(quotes); + + const quoteP = document.querySelector("#quote"); + const authorP = document.querySelector("#author"); + + quoteP.innerText = randomQuote.quote; + authorP.innerText = randomQuote.author; +} + +showRandomQuote(); + +const newQuoteBtn = document.querySelector("#new-quote"); +newQuoteBtn.addEventListener("click", showRandomQuote);