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; +}