const link = "https://type.fit/api/quotes";
diceBtn.addEventListener("click",fetchQuote);//changes quote by click
function fetchQuote(){
fetch(link)
.then(response => response.json())
.then(data => {
const randomQuoteIndex = Math.round(Math.random()*data.length);
quote.innerHTML = data[randomQuoteIndex].text;
(data[randomQuoteIndex]);
});
}
fetchQuote();//starts page with quote immediatly
// get a quote from random api