I found this code for randomly displaying text, but I want it to display the text strings in rotation instead of randomly.
Anyone help on coding this?
<html>
<head>
<title>Random Text</title>
<script type=”text/javascript”>
var textarray = [
“Notable Commanders, 3rd Armored Division”,
“Major General Alvin C. Gillem Jr., April 1941 to January 1942”,
“Major General Walton H. Walker, January 1941 to August 1942”,
“Major General Leroy R. Watson, August 1942 to August 1944”,
“Major General Maurice Rose, August 1944 to March 1945 KIA”,
“Brigadier General Doyle O. Hickey, March to June 1945”,
“Brigadier General Truman E. Boudinot, June & July 1945”,
“Brigadier General Frank A. Allen, Jr., July 1945”,
“Major General Robert W. Grow, July 1945 until inactivation”
// No comma after last entry
];
function RndText() {
var rannum= Math.floor(Math.random()*textarray.length);
document.getElementById(‘ShowText’).innerHTML=textarray[rannum];
}
onload = function() { RndText(); }
// Remove slashes from the next line if you want automatic rotation
var inter = setInterval(function() { RndText(); }, 2000);
</script>
</head>
<body>
<div style=”color:blue;” id=”ShowText”></div>
</body>
</html>