Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Sprint-3/quote-generator/index.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Title here</title>
<title>Quote generator app</title>
<script defer src="quotes.js"></script>
</head>
<body>
Expand Down
12 changes: 12 additions & 0 deletions Sprint-3/quote-generator/quotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -491,3 +491,15 @@ const quotes = [
];

// call pickFromArray with the quotes array to check you get a random quote
const displayQuote = document.querySelector("#quote");
const displayAuthor = document.querySelector("#author");
const btn = document.querySelector("#new-quote");

function quoteGenerator() {
const myQuotes = pickFromArray(quotes);
displayQuote.textContent = myQuotes.quote;
displayAuthor.textContent = myQuotes.author;
}

btn.addEventListener("click", quoteGenerator);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a random quote when the page loads

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your review I will update this functionality and commit Asap

window.addEventListener("load", quoteGenerator);
Loading