title: Compatibility issues with <a> and calling a function(); across different web browsers
body: <p>I am new to javascript. I wrote the following function rollDice() to produce 5 random numbers and display them. I use an anchor with click event to call the function. Problem is, in Chrome it won't display, works fine in IE, in firefox the 5 values display and then the original page w/anchor appears! I am suspicious that my script tag is too general but I am really lost. Also if there is a display function that doesn't clear the screen first that would be great.</p>
  
  <p>
  
  
  </p>
  
  <p>diceArray = new Array(5)</p>
  
  <p>function rollDice()
  {
   var i;</p>
  
  <p>for(i=0; i&lt;5; i++)
   {
    diceArray[i]=Math.round(Math.random() * 6) % 6 + 1;</p>
  
  <p>document.write(diceArray[i]); 
   }
  }
  
  </p>
  
  <p></p>
  
  <p>when I click should display 5 rand variables</p>
  
  <p>
  </p>