From 27d32e10b2f61986e80771fd93bb2bb8aaea913d Mon Sep 17 00:00:00 2001 From: ofonimeedak Date: Sat, 28 Mar 2026 16:08:33 +0000 Subject: [PATCH 1/2] Add dom manipualtion to quote.js --- Sprint-3/quote-generator/quotes.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index 4a4d04b72..b9bfa5ba2 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -491,3 +491,14 @@ const quotes = [ ]; // call pickFromArray with the quotes array to check you get a random quote +const displayQuote = document.querySelector("#quote"); +const displayAuthor = document.querySelector("#author"); +const btn = document.querySelector("#new-quote"); + +function quoteGenerator() { + const myQuotes = pickFromArray(quotes); + displayQuote.textContent = myQuotes.quote; + displayAuthor.textContent = myQuotes.author; +} + +btn.addEventListener("click", quoteGenerator); From a67d644fa8aafdcdd37719c2f58d475a15f7bab0 Mon Sep 17 00:00:00 2001 From: ofonimeedak Date: Tue, 7 Apr 2026 04:46:31 +0100 Subject: [PATCH 2/2] update onload event and page title --- Sprint-3/quote-generator/index.html | 4 ++-- Sprint-3/quote-generator/quotes.js | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Sprint-3/quote-generator/index.html b/Sprint-3/quote-generator/index.html index 30b434bcf..befe8788e 100644 --- a/Sprint-3/quote-generator/index.html +++ b/Sprint-3/quote-generator/index.html @@ -1,9 +1,9 @@ - + - Title here + Quote generator app diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index b9bfa5ba2..7241f16d3 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -502,3 +502,4 @@ function quoteGenerator() { } btn.addEventListener("click", quoteGenerator); +window.addEventListener("load", quoteGenerator);