We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent debc327 commit a6bbeaeCopy full SHA for a6bbeae
Sprint-3/quote-generator/quotes.js
@@ -491,3 +491,16 @@ const quotes = [
491
];
492
493
// call pickFromArray with the quotes array to check you get a random quote
494
+const quoteElement = document.querySelector("#quote");
495
+const authorElement = document.querySelector("#author");
496
+const newQuoteBtn = document.querySelector("#new-quote");
497
+
498
+function displayRandomQuote() {
499
+ const randomQuote = pickFromArray(quotes);
500
+ quoteElement.innerText = randomQuote.quote;
501
+ authorElement.innerText = randomQuote.author;
502
+}
503
504
+displayRandomQuote();
505
506
+newQuoteBtn.addEventListener("click", displayRandomQuote);
0 commit comments