title: How do I generate a random font to a line of text every time page is refreshed?
body: <p>I am trying to generate a new font every time my page is refreshed from a list in my JavaScript. I want 4 fonts total, and I want the line that reads "Font" to be the font that actually changes. I can't get the font to change at all anytime I refresh the page. Any way I can possibly do that with JavaScript? Here are some things I tried:</p>
  
  <pre><code>&lt;script&gt;
  var fontType = [ "Arial", "Verdana", "Helvetica"];
  var num;
  num=Math.floor(Math.random()*3);
  document.getElementById("fontfamily").src=fontType[num];
  &lt;/script&gt;
  </code></pre>
  
  <p>This didn't seem to work. I wondered I'd have to call an ID for the fonts, but is there even such a thing as "GetelementById(fontfamily)"? This was also in my body tags. </p>
  
  <pre><code>var font = [];
  font[0] = "Times New Roman";
  font[1] = "Arial";
  font[2] = "Helvetica";
  </code></pre>
  
  <p>Would this be a better option? How would I get this to randomly choose? </p>