title: How to add two input time values and display it in another input box?
body: <p>I am getting two durations, <code>current time</code> and <code>previous time</code> from user. now, i want to calculate the total time show it on the third textbox. </p>
  
  <pre><code>&lt;p&gt;&lt;span&gt;Current Duration&lt;/span&gt;&lt;input id="txt1" onblur="sum();" type="text" autocomplete="off" name="current_duration" value="" /&gt;&lt;/p&gt;
  &lt;p&gt;&lt;span&gt;Previous Duration&lt;/span&gt;&lt;input id="txt2" onblur="sum();" type="text" autocomplete="off" name="previous_duration" value="" /&gt;&lt;/p&gt;
  &lt;p&gt;&lt;span&gt;Total Duration&lt;/span&gt;&lt;input id="txt3" type="text" readonly autocomplete="off" name="total_duration" value="" /&gt;&lt;/p&gt;
  &lt;script&gt;
  
      function sum() {
          var txtFirstNumberValue = document.getElementById('txt1').value;
          var txtSecondNumberValue = document.getElementById('txt2').value;
  
          var result = parseInt(txtFirstNumberValue) + parseInt(txtSecondNumberValue);
          if (!isNaN(result)) {
              document.getElementById('txt3').value = result;
  
          }
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>How can i implement the same? can you guys help me out?</p>