-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
31 lines (25 loc) · 1.12 KB
/
script.js
File metadata and controls
31 lines (25 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const quotes = [
"The only true wisdom is in knowing you know nothing.",
"An unexamined life is not worth living.",
"I cannot teach anybody anything. I can only make them think.",
"The unexamined life is not worth living.",
"To find yourself, think for yourself.",
"Wisdom begins in wonder.",
"I know that I am intelligent because I know that I know nothing.",
"True knowledge exists in knowing that you know nothing.",
"Education is the kindling of a flame, not the filling of a vessel.",
"He who is not a good servant will not be a good master.",
];
function getRandomQuote() {
const randomIndex = Math.floor(Math.random() * quotes.length);
return quotes[randomIndex];
}
document.addEventListener('DOMContentLoaded', function() {
const quoteElement = document.getElementById('quote');
quoteElement.textContent = getRandomQuote();
});
const newQuoteButton = document.getElementById('new-quote');
newQuoteButton.addEventListener('click', function() {
const quoteElement = document.getElementById('quote');
quoteElement.textContent = getRandomQuote();
});