diff --git a/Sprint-3/quote-generator/index.html b/Sprint-3/quote-generator/index.html index 30b434bcf..cefea5da7 100644 --- a/Sprint-3/quote-generator/index.html +++ b/Sprint-3/quote-generator/index.html @@ -3,13 +3,19 @@ - Title here - + Quote Generator App + -

hello there

-

-

- +
+
+

Quote Generator App

+

+

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