title: HTML display result in text (input) field?
body: <p>I have a simple HTML form, with 3 input field, when you hit = button, it suppose to add 2 numbers that you typed in the first 2 input fields and display result in 3rd filed. Is it possible to do that? (I need result in a box (or table) or some thing rather than in plain text). I try the following but doesn't work (it does nothing), can somebody help me?</p>
  
  <pre><code>&lt;HTML&gt;
        &lt;HEAD&gt;
          &lt;TITLE&gt;Sum&lt;/TITLE&gt;
  
          &lt;script type="text/javascript"&gt;
            function sum()
            {
               var num1 = document.myform.number1.value;
               var num2 = document.myform.number2.value;
               var sum = parseInt(num1) + parseInt(num2);
               document.getElementById('add').innerHTML = sum;
            }
          &lt;/script&gt;
        &lt;/HEAD&gt;
  
        &lt;BODY&gt;
          &lt;FORM NAME="myform"&gt;
            &lt;INPUT TYPE="text" NAME="number1" VALUE=""&gt; + 
            &lt;INPUT TYPE="text" NAME="number2" VALUE=""&gt;
            &lt;INPUT TYPE="button" NAME="button" Value="=" onClick="sum()"&gt;
            &lt;INPUT TYPE="text" ID="add" NAME="result" VALUE=""&gt;
          &lt;/FORM&gt;
  
        &lt;/BODY&gt;
  &lt;/HTML&gt;
  </code></pre>