Created
June 29, 2020 21:42
-
-
Save faithgaiciumia/c3ad8dfa319b9a8ebcb48fcac689e20e to your computer and use it in GitHub Desktop.
Complete app.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const quotes = [ | |
{ quote: "You're only as sick as your secrets.", author: "Anonymous" }, | |
{ | |
quote: "To remain young one must change.", | |
author: "Alexander Chase", | |
}, | |
{ | |
quote: | |
"Those who seek happiness miss it, and those who discuss it, lack it.", | |
author: "Holbrook Jackson", | |
}, | |
{ | |
quote: "Ten thousand men possess ten thousand hopes.", | |
author: "Euripides", | |
}, | |
{ | |
quote: | |
"A great secret of success is to go through life as a man who never gets used up.", | |
author: "Albert Schweitzer", | |
}, | |
]; | |
function generateQuote() { | |
var randomIndex = Math.floor(Math.random()*quotes.length); | |
document.getElementById("quote").innerHTML=quotes[randomIndex].quote; | |
document.getElementById("author").innerHTML="~"+ " " + quotes[randomIndex].author; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment