diff --git a/Sprint-3/quote-generator/quotes.js b/Sprint-3/quote-generator/quotes.js index 4a4d04b72..a895bc104 100644 --- a/Sprint-3/quote-generator/quotes.js +++ b/Sprint-3/quote-generator/quotes.js @@ -1,3 +1,13 @@ +const showNewQuote = () => { + const {quote, author} = pickFromArray(quotes); + document.getElementById("quote").innerText = quote; + document.getElementById("author").innerText = author; +}; + +document.addEventListener("DOMContentLoaded", () => { showNewQuote(); }); + +document.querySelector("button").addEventListener("click", () => { showNewQuote(); }); + // DO NOT EDIT BELOW HERE // pickFromArray is a function which will return one item, at