-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
62 lines (41 loc) · 1.34 KB
/
index.js
File metadata and controls
62 lines (41 loc) · 1.34 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
const quotes = [
{
quote: "Mistakes are the proof that you are trying.",
author: "Bunty Virani"
},
{
quote: "Exprience is simply the name given we give our mistakes.",
author: "Mark Twain"
},
{
quote: "The key to success is failure.",
author: "Michael Jordan"
},
{
quote: "Imagination is more important than knowledge.",
author: "Albert Einstein"
},
{
quote: "No one is perfect. That's why pencil have eraser.",
author: "Yasin Virani"
},
{
quote: "To succeed in life, you need two things:Ignorance and confidience.",
author: "Mark Twain"
}
];
function newquote() {
var randomnumber = Math.floor(Math.random() * quotes.length);
console.log('the value of quotes is :',quotes[randomnumber].quote);
document.getElementById("text").innerHTML = quotes[randomnumber].quote;
document.getElementById("author").innerHTML = quotes[randomnumber].author;
document.getElementById("tweet-quote").href = "https://twitter.com/intent/tweet?text=Hello%20world" + quotes[randomnumber];
}
// function tweetQuote()
// {
// window.open('https://twitter.com/intent/tweet?text= Hello' + quotes[randomnumber]);
// }
// var shareQuote = function(){
// window.open('https://twitter.com/intent/tweet' + quotes)
//
// console.log('the value of quotes is :',quotes[randomnumber].quote);