Below is some code for loading quotes from a javascript array of objects every 5 seconds:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Quotes every 5 seconds</title>
<style>
.quote {
width: 30%;
margin: 0 auto;
border: 1px solid #000;
padding: 20px;
}
.quote blockquote {
margin: 0;
padding: 0;
font-size: 30px;
text-align: center;
}
.quote blockquote span {
margin: 0;
padding: 0;
font-size: 18px;
}
</style>
</head>
<body>
<div class="quote">
<blockquote>
The quick red fox<br>
<span>Author 1</span>
</blockquote>
</div>
<!-- end quote -->
<script>
const quote = document.querySelector('.quote');
const quotations = [
{quotation: 'The quick red fox', author: 'Author 1'},
{quotation: 'The lazy brown dog', author: 'Author 2'},
{quotation: 'The cat in the hat', author: 'Author 3'},
{quotation: 'The night watchman', author: 'Author 4'},
{quotation: 'A funny thing happened on the way to the forum', author: 'Author 5'},
];
let count = 0;
setInterval(function(){
count++;
if(count === quotations.length) {
count = 0;
}
quote.innerHTML = `
<blockquote>
${quotations[count].quotation}
<br>
<span>${quotations[count].author}</span>
</blockquote>
`;
},
5000);
</script>
</body>
</html>