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