-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
94 lines (88 loc) · 2.58 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
$(document).ready(function () {
//Array of objects
quoteArray = [{
quote: "To be without a friend is to be poor indeed.",
author: "Tanzanian proverb"
},
{
quote: "Unity is strength, division is weakness.",
author: "Swahili proverb"
},
{
quote: "Sticks in a bundle are unbreakable.",
author: "Bondei proverb"
},
{
quote: "A single bracelet does not jingle.",
author: "Congolese proverb"
},
{
quote: "A single stick may smoke, but it will not burn.",
author: "African proverb"
},
{
quote: "A family is like a forest, when you are outside it is dense, when you are inside you see that each tree has its place.",
author: "African Proverb"
},
{
quote: "A united family eats from the same plate.",
author: "Baganda proverb"
},
{
quote:"He who earns calamity, eats it with his family.",
author:"~ African proverb"
},
{
quote:"If relatives help each other, what evil can hurt them?",
author:"~ African proverb"
},
{
quote:"Home affairs are not talked about on the public square.",
author:"~ African proverb"
},
{
quote:"There is no fool who is disowned by his family.",
author:"~ African proverb"
},
{
quote:"Dine with a stranger but save your love for your family.",
author:"~ Ethiopian proverb"
},
{
quote:"Brothers love each other when they are equally rich.",
author:"~ African proverb"
},
{
quote:"If I am in harmony with my family, that’s success." ,
author:"~ Ute proverb"
},
{
quote:"A family tie is like a tree, it can bend but it cannot break.",
author: "~ African proverb"
},
{
quote:"Dine with a stranger but save your love for your family.",
author:"~ Ethiopian proverb"
},
{
quote:"The old woman looks after the child to grow its teeth and the young one in turn looks after the old woman when she loses her teeth. ",
author:"~ Akan (Ghana, Ivory Coast) proverb"
},
{
quote:"When brothers fight to the death, a stranger inherits their father’s estate.",
author: "~ Ibo proverb"
},
{
quote:"Children are the reward of life. ",
author:"~ African proverb"
},
];
$("#button").on("click", function () {
let randomNumber = Math.floor(Math.random() * quoteArray.length);
//console.log(randomNumber);
// $("#quote").text(quoteArray[randomNumber]["quote"]);
// $("#author").text(quoteArray[randomNumber]["author"]);
document.querySelector("#quote").innerHTML = quoteArray[randomNumber]["quote"];
document.querySelector("#author").innerHTML = quoteArray[randomNumber]["author"];
}); //ends button on click
}); //ends document.ready