How would I make the following change at an interval, say, 500, as opposed to being on page load?
I'm assuming this is doable
var textarray = [
"1",
"2",
"3",
"4",
"5"
];
function RndText() {
var rannum= Math.floor(Math.random()*textarray.length);
document.getElementById('ShowText').innerHTML=textarray[rannum];
}
window.onload = function() { RndText(); }
Would there be a way to make the script read from say, an external .txt file? As opposed to an Array within the document itself?