I created a javascript code where it shows me several random texts, but these only change with the refresh of the page.
And I wanted them to change every 5 seconds without refresh.
Javascript:
(function() {
var quotes = [
{
text: " HEY ITS ME",
},
{
text: " HEY YOU TO",
}
];
var quote = quotes[Math.floor(Math.random() * quotes.length)];
document.getElementById("quote").innerHTML =
'<i class="fas fa-graduation-cap"></i> ' + quote.text + '';
})();