Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const newQuoteButton =document.getElementById('new-quote-button')
const quoteContainer=document.createElement("div")
const quoteList =document.getElementById('quote-list')
const quoteArray=[
"The only thing we have to fear is fear itself." ,
"In three words I can sum up everything I've learned about life: it goes on." ,
"The only limit to our realization of tomorrow will be our doubts of today.",
"The greatest glory in living lies not in never falling, but in rising every time we fall.",
"To be yourself in a world that is constantly trying to make you something else is the greatest accomplishment."
]
newQuoteButton.addEventListener("click",()=>{
const random_Index = Math.floor(Math.random() * quoteArray.length);
const randomQuote =quoteArray[random_Index]
const quoteText = document.createElement("p")
quoteText.textContent=randomQuote
quoteContainer.appendChild(quoteText)
quoteList.appendChild(quoteContainer)
})