Skip to content

Instantly share code, notes, and snippets.

@faithgaiciumia
Created June 29, 2020 21:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save faithgaiciumia/c3ad8dfa319b9a8ebcb48fcac689e20e to your computer and use it in GitHub Desktop.
Save faithgaiciumia/c3ad8dfa319b9a8ebcb48fcac689e20e to your computer and use it in GitHub Desktop.
Complete app.js
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