There is a thread expressing a similar problem to you here. The bottom post will explain the problem.
In this day and age document.write isn't recommended and the Javascript DOM should be referenced instead.
Heres your code but using the DOM method instead:
HTML Code:
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<SCRIPT type="text/javascript" language="javaScript">
var diceArray = new Array(5);
function rollDice() {
for(i=0; i<5; i++) {
diceArray[i]=Math.round(Math.random() * 6) % 6 + 1;
}
document.getElementById('dice_numbers').innerHTML = diceArray.join(" ");
}
</SCRIPT>
</HEAD>
<BODY>
<a href="#" onClick="rollDice();">when I click should display 5 rand variables</a>
<div id="dice_numbers"></div>
</BODY>
</HTML>
Let me know if you have any questions reference the above code.
Bookmarks