title: Assign variable to innerHTML
body: <p>First, I am not too verse with JavaScript. I would like to build a HTML table TD elements with content dynamically using JavaScript. Here is my code that is not working properly.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function changed(num){
      a1=num;
      a2=num+1;
      a3=num+2;
  
      for(var i=1;i&lt;=3;i++){
         document.getElementById("boxA"+i).innerHTML=eval('a'+i);
      }
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>Here is the HTML code:</p>
  
  <pre><code>&lt;input type="text" name="box" onChange="changed(this.value);"&gt;
  
  &lt;table width="400" border="10" cellpadding="5"&gt;
  &lt;tr&gt;
      &lt;td id="boxA1"&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td id="boxA2"&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td id="boxA3"&gt;&amp;nbsp;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>If I entered the value 1 in the input field, the following values should be 1, 2, 3</p>