-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproject.js
More file actions
48 lines (43 loc) · 1.24 KB
/
Copy pathproject.js
File metadata and controls
48 lines (43 loc) · 1.24 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
let btn = document.querySelector('.new-quote');
let quote= document.querySelector(".quote");
let person = document.querySelector(".person");
const quotes = [
{
quote: "Genius is one percent inspiration and ninety-nine percent perspiration.",
person: "Thomas Edison"
},
{
quote: "You can observe a lot just by watching.",
person: "Yogi Berra"
},
{
quote: "A house divided against itself cannot stand.",
person: "Abraham Lincoln"
},
{
quote: "Difficulties increase the nearer we get to the goal.",
person: "Johann Wolfgang von Goethe"
},
{
quote: "Fate is in your hands and no one elses",
person: "Byron Pulsifer"
},
{
quote: "Be the chief but never the lord.",
person: "Lao Tzu"
},
{
quote: "Nothing happens unless first we dream.",
person: "Carl Sandburg"
},
{
quote: "Well begun is half done.",
person: "Aristotle"
}
,];
btn.addEventListener('click', function (){
let random= Math.floor(Math.random() *quotes.length);
console.log("Random");
quote.innerText=quotes[random].quote;
person.innerText=quotes[random].person;
});