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 1a5069a commit ccc7e21Copy full SHA for ccc7e21
Sprint-3/quote-generator/quotes.js
@@ -491,3 +491,19 @@ const quotes = [
491
];
492
493
// call pickFromArray with the quotes array to check you get a random quote
494
+const quoteEl = document.querySelector("#quote");
495
+const authorEl = document.querySelector("#author");
496
+const button = document.querySelector("#new-quote");
497
+
498
+function displayQuote() {
499
+ const randomQuote = pickFromArray(quotes);
500
501
+ quoteEl.textContent = randomQuote.quote;
502
+ authorEl.textContent = randomQuote.author;
503
+}
504
505
+// Show initial quote on page load
506
+displayQuote();
507
508
+// Change quote when button is clicked
509
+button.addEventListener("click", displayQuote);
0 commit comments