-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
50 lines (45 loc) · 1.79 KB
/
script.js
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//Scripts
//Variables
let btn = document.querySelector('#new-quote');
let quote = document.querySelector('.quote');
let person = document.querySelector('.person');
const quotes = [{
quote: `"The best way to find yourself is to lose yourself in the service of others."`,
person: ` Mahatma Gandhi`
}, {
quote: `"If you want to live a happy life, tie it to a goal, not to people or things."`,
person: ` Albert Einstein`
}, {
quote: `"At his best, man is the noblest of all animals; separated from law and justice he is the worst."`,
person: `Aristotle`
}, {
quote: `"Your time is limited, so dont waste it living someone else's life."`,
person: ` Steve Jobs`
}, {
quote: `"Tell me and I forget. Teach me and I remember. Involve me and I learn."`,
person: ` Benjamin Franklin`
}, {
quote: `"If you look at what you have in life, you'll always have more. If you look at what you don't have in life, you'll never have enough."`,
person: `Oprah Winfrey`
}, {
quote: `"t does not matter how slowly you go as long as you do not stop."`,
person: `Confucius`
}, {
quote: `"Our lives begin to end the day we become silent about things that matter."`,
person: `Martin Luther King, Jr.`
}, {
quote: `"Remember that not getting what you want is sometimes a wonderful stroke of luck."`,
person: `Dalai Lama`
}, {
quote: `"The journey of a thousand miles begins with one step."`,
person: `Lao Tzu`
},
{
quote: `"Remember to always Listen to your wife."`,
person: `Anushka Khadatkar`
},];
btn.addEventListener('click', function () {
let random = Math.floor(Math.random() * quotes.length);
quote.innerText = quotes[random].quote;
person.innerText = quotes[random].person;
})