I'm trying to create a simple JS that will get random arrays and post them via div container. Here's what I have so far, now keep in mind I'm horrible with JS.
function timedMsg() {
currMsg++;
document.getElementById('timedMsgDiv').innerHTML = msgArr[currMsg % msgArr.length];
};
function init() {
currMsg = -1;
msgArr = Array('Computer.', 'Uploading', 'Random');
timedMsg();
var t = setInterval("timedMsg()", 50);
};
window.onload = init();
It only gets 'Computer' and then does not flip through them randomly or loop or anything. Any reason why? Here's my JSFiddle: http://jsfiddle.net/R8SYf/