-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
48 lines (43 loc) · 1.37 KB
/
main.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
//Get All Quotes
const quotes = [
{
quote:
"Code Never Lies, Comments Sometimes Do.",
author: "- Ron Jeffries"
},
{
quote:
"Programmers are constantly making things more complicated than they need to be because future. Program for Today.",
author: "- David Heinemeier Hansson"
},
{
quote:
"Code is like humor. When you have to explain it, It's Bad.",
author: "- Cory House"
},
{
quote: "The proper use of comments is to compensate for our failure to express ourself in code.",
author: "- Robert C Martin"
},
{
quote:
"If You Can't deploy your services independently then they are not microservice. ",
author: "- Daniel Bryant"
},
{
quote:
"Programming is key concept who want to understand and must have interested of ourself.",
author: " - Code Express"
}
];
//Button Generate Quotes
const btn = document.querySelector('.generate');
//Add Event Listener
btn.addEventListener('click', () => {
//Get Random text of Quotes
let random = Math.floor(Math.random() * quotes.length);
// console.log(random);
//Now Show Text On Screen
document.querySelector('.qstring').innerText = quotes[random].quote;
document.querySelector('.qauthor').innerText = quotes[random].author;
});