random,setInterval

Posted 2008. 6. 10. 15:42 by maxmini MAXMINI

<script type="text/javascript">
var myTest = new Array('AAA','BBB','CCC','DDD','EEE');
document.write(randomItem(myTest),'<br/>');
document.write(randomItem(myTest),'<br/>');
document.write(randomItem(myTest),'<br/>');

function randomItem(){
    return myTest[Math.floor(Math.random()*myTest.length)];
//    document.all.a.innerText = myTest[Math.floor(Math.random()*myTest.length)];
}
window.setInterval("randomItem() ",1000);
</script>

Tag : , ,

Write your message and submit
« PREV : 1 : ··· : 6 : 7 : 8 : 9 : 10 : 11 : 12 : 13 : 14 : 15 : NEXT »