Hello!
i have a problem, which is i can not get this code right:
Code:
<html>
<head>
<script type = "text/javascript">
var body2 = document.getElementById("body2");
var talk_sen = ["", "did","do", "not"];
var ran_talk_sen = talk_sen[Math.floor(Math.random() * talk_sen.length)];
setInterval(function(){document.write(ran_talk_sen)},3000);
</script>
</head>
<body>
</body>
</html>
SO the idea is, every 3 seconds if prints out a random element of the array, this does not quite work because
it only prints out 'do' then after 3 secs it prints 'do' etc, until my page says dodododododododododododododododododo.
i am hoping for diddonotnotnotdiddodidnotdodonotdiddid - or something random like that!
Thanks!!!