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 4a4d04b72..7241f16d3 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -491,3 +491,15 @@ 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); +window.addEventListener("load", quoteGenerator);