title: How to use a for loop for assigning a value in an array?
body: <p>I was trying to draw a tic tac toe board by using a for loop in javascript to create it. But it wasn't drawing it at all. I know that the two files are linked because I tried it out before. But this isn't working. Anyone know an answer. </p>
  
  <p>Javascript
  <div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var array = [" "," "," "," "," "," "," "," "," "];
  for(i = 0;i &lt; 8;i++){
   array[i] = "| |";
   document.getElementById(board).innerHTMl = "|   |"];
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt; 
  &lt;head&gt;
  &lt;link rel="stylesheet" href="style.css" type="text/css"&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div id="body"&gt;
  &lt;div&gt;&lt;h1 id="middle"&gt;Tic Tac Toe&lt;/h1&gt;&lt;/div&gt;
  &lt;p id="board"&gt;&lt;/p&gt;
  &lt;script src="script.js"&gt;&lt;/script&gt;
  
  &lt;/div&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>