title: get the quotient of two textbox which has an onChange event
body: <p>I get the sum of ua and ub and display on tu textbox. I multiplied the ua 
  and ga textbox and display on uu textbox as well as the ub ang gb . Get 
  the sum of uu and a and display on tt textbox. I want to get the quotient 
  of tt and tu and display on gpa textbox but it doesnt work. Please help. 
  Thanks in advance.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>    function sum(){
      var ua = document.getElementById('ua').value;
      var ub = document.getElementById('ub').value;
      var result = parseInt(ua)  + parseInt(ub);
      if (!isNaN(result)) {
      document.getElementById('tu').value = result;
      document.getElementById('tu').dispatchEvent(new Event('change'));
      }
      }
      function suma(){
      var ua = document.getElementById('ua').value;
      var ga = document.getElementById('ga').value;   
      var result = parseInt(ua)  * parseInt(ga);
      if (!isNaN(result)) {
      document.getElementById('uu').value = result;
      document.getElementById('uu').dispatchEvent(new Event('change'));
      }
      }
      function sumb(){
      var ub = document.getElementById('ub').value;
      var gb = document.getElementById('gb').value;   
      var result = parseInt(ub)  * parseInt(gb);
      if (!isNaN(result)) {
      document.getElementById('a').value = result;
      document.getElementById('a').dispatchEvent(new Event('change'));
      }
      }
      function s(){
      var uu = document.getElementById('uu').value;
      var a = document.getElementById('a').value;
      var result = parseInt(uu)  + parseInt(a);
      if (!isNaN(result)) {
      document.getElementById('tt').value = result;
      document.getElementById('tt').dispatchEvent(new Event('change'));
      }
      }
      function g(){
      var tt = document.getElementById('tt').value;
      var tu = document.getElementById('tu').value;
      var result = parseFloat(tt)  / parseFloat(tu);
      if (!isNaN(result)) {
      document.getElementById('gpa').value = result;
      }
      }
  
  
   </code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>   &lt;input type="text"  id="ua" name="ua" size="7" onkeyup="sum();"&gt;
      &lt;input type="text"  id="ga" name="ga" size="7" onkeyup="suma();"&gt;
      &lt;input type="text"  id="uu" name="uu" size="7" onchange="s();"/&gt;
  
      &lt;input type="text"  id="ub" name="ub" size="7" onkeyup="sum();"&gt;
      &lt;input type="text"  id="ga" name="ga" size="7" onkeyup="sumb();"&gt;
      &lt;input type="text"  id="a" name="a" size="7" onchange="s();"/&gt;
  
      &lt;input type="text" id="tu" name="tu" onchange="g();"/&gt;
      &lt;input type="text" id="tt" name="tt" onchange="g();"/&gt;
  
      &lt;label&gt;GPA&lt;/label&gt;
      &lt;input type="text" id="gpa" /&gt;</code></pre>
  </div>
  </div>
  </p>