title: Add two numbers and display result in textbox with Javascript
body: <p>I was just trying to write a simple javascript program that will demonstrate to take user input from text field, and clicking the button will display the summation result of those number in another text field. But unfortunately the below code is not working. Clicking the button does not show anything in the result text field. </p>
  
  <pre><code>&lt;body&gt;
      &lt;div&gt;
          &lt;div&gt;
              &lt;h1&gt;Add two number using text box as input using javascript&lt;/h1&gt;
          &lt;/div&gt;
              Enter First Number : &lt;br&gt;
              &lt;input type="text" id="Text1" name="TextBox1"&gt;
              &lt;br&gt;
              Enter Second Number : &lt;br&gt;
              &lt;input type="text" id="Text2" name="TextBox2"&gt;
              &lt;br&gt;
              Result : &lt;br&gt;
              &lt;input type="text" id="txtresult" name="TextBox3"&gt;
              &lt;br&gt;
           &lt;input type="button" name="clickbtn" value="Display Result" onclick="add_number()"&gt;
  
          &lt;script type="text/javascript"&gt;
              function add_number(){
              var first_number = parseInt(document.getElementsById("Text1").value);
              var second_number = parseInt(document.getElementsById("Text2").value);
              var result = first_number + second_number;
              document.getElementById("txtresult").innerHTML = result;    
              }
          &lt;/script&gt;
  </code></pre>