Forum Moderators: open
I have used javascript to be able to load a random image (from an array) on page load in the past. Is this possible to do with a div of content?
I have 3 areas on a page that the client wants to randomize - i know i could do it if the content was flash, or images, not sure if i can with html text in a div...
Thanks in advance.
Shawna
var randomID = Math.ceil(100*Math.random())
var UpdateDiv = document.getElementById('yourDivID');UpdateDiv.innerHTML=yourArray[randomID];
<div id="yourDivID"></div>
i would think that should work easily