title: javascript getting my textbox to display a variable
body: <p>So I have some basic code in html here, i just have two textbox which u can type numbers in and when you click the button, it adds em both up, and in a perfect world, it would display the answer in that third textbox.</p>
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;/head&gt;
  &lt;script type=&quot;text/javascript&quot;&gt;
      function myfunction()
      {
          var first = document.getElementById(&quot;textbox1&quot;).value;
          var second = document.getElementById(&quot;textbox2&quot;).value;
          var answer = +first + +second;
          var textbox3 = answer;
      }
  &lt;/script&gt;
  &lt;body&gt;
      &lt;input type=&quot;text&quot; name=&quot;textbox1&quot; id=&quot;textbox1&quot; /&gt;
      +
      &lt;input type=&quot;text&quot; name=&quot;textbox2&quot; id=&quot;textbox2&quot; /&gt;
      &lt;input type=&quot;submit&quot; name=&quot;button&quot; id=&quot;button1&quot; onclick=&quot;myfunction()&quot; value=&quot;=&quot; /&gt;
      
      &lt;input type=&quot;text&quot; name=&quot;textbox3&quot; id=&quot;textbox3&quot; readonly=&quot;true&quot;/&gt;
      &lt;br /&gt;
      Your answer is: --
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>however, i can't get the answer to display in that textbox3. Does anyone know how to assign a value to that third textbox from a variable?</p>
  <p>also, as an added bonus, if anyone knows a way to also make the last line &quot;Your answer is: --&quot; display the answer as well, that would be amazing.</p>