title: how to use javascript onkeyup for multiple ids at sametime
body: <p>I have 2 html textbox for users to enter numbers. To sum those numbers, I am passing the values to JavaScript variable and after addition displaying the result to html div section</p>
  
  <pre><code>&lt;div class="input-left"&gt;&lt;span&gt;&lt;input  class="textbox" id="left" name="count" type="text" size="5"  value="" /&gt;&lt;/span&gt;&lt;/div&gt;
  
  &lt;div class="input-right"&gt;&lt;span&gt;&lt;input  class="textbox" id="right" name="count" type="text" size="5"  value="" /&gt;&lt;/span&gt;&lt;/div&gt;
  
  &lt;div id="result"&gt; &lt;/div&gt;
  </code></pre>
  
  <p>javascript:</p>
  
  <pre><code>document.getElementById('left').onkeyup = function() {
      var a = parseFloat(this.value);
  
  }
  
  document.getElementById('right').onkeyup = function() {
      var b = a + parseFloat(this.value);
      document.getElementById("result").innerHTML = b || 0 ;
  }
  </code></pre>
  
  <p>But  I have an issue with JavaScript. It not displaying the result. How to add both functions in same onkeyup function.</p>
  
  <p><a href="http://fiddle.jshell.net/gYV8Z/" rel="nofollow"><strong>FIDDLE SETUP</strong></a></p>