From 1f8d1d12fb0da943275c09a410135495838ae414 Mon Sep 17 00:00:00 2001 From: Raihan Sharif Date: Fri, 27 Feb 2026 10:27:35 +0000 Subject: [PATCH] implement quote generator --- Sprint-3/quote-generator/index.html | 5 +++-- Sprint-3/quote-generator/quotes.js | 11 +++++++++++ Sprint-3/quote-generator/style.css | 3 +++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Sprint-3/quote-generator/index.html b/Sprint-3/quote-generator/index.html index 30b434bcf..fe554a7e3 100644 --- a/Sprint-3/quote-generator/index.html +++ b/Sprint-3/quote-generator/index.html @@ -1,10 +1,11 @@ - + - Title here + Quote generator +

hello there

diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index 4a4d04b72..de6103751 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 quoteText = document.getElementById("quote"); +const authorText = document.getElementById("author"); + +const newQuoteBtn = document.getElementById("new-quote"); + +newQuoteBtn.addEventListener("click", () => { + const selectedQuote = pickFromArray(quotes); + quoteText.textContent = selectedQuote.quote; + authorText.textContent = `-- ${selectedQuote.author}`; +}); diff --git a/Sprint-3/quote-generator/style.css b/Sprint-3/quote-generator/style.css index 63cedf2d2..b58fd4785 100644 --- a/Sprint-3/quote-generator/style.css +++ b/Sprint-3/quote-generator/style.css @@ -1 +1,4 @@ /** Write your CSS in here **/ +#author { + font-style: italic; +}