Skip to content

Commit 27d32e1

Browse files
committed
Add dom manipualtion to quote.js
1 parent 96d077b commit 27d32e1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Sprint-3/quote-generator/quotes.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,3 +491,14 @@ const quotes = [
491491
];
492492

493493
// call pickFromArray with the quotes array to check you get a random quote
494+
const displayQuote = document.querySelector("#quote");
495+
const displayAuthor = document.querySelector("#author");
496+
const btn = document.querySelector("#new-quote");
497+
498+
function quoteGenerator() {
499+
const myQuotes = pickFromArray(quotes);
500+
displayQuote.textContent = myQuotes.quote;
501+
displayAuthor.textContent = myQuotes.author;
502+
}
503+
504+
btn.addEventListener("click", quoteGenerator);

0 commit comments

Comments
 (0)