title: Multiplication of inputs & sum of inputs using JavaScript
body: <p>I am trying to write an application where we have a HTML table with 4 rows (for simplicity's sake) &amp; 3 columns. </p>
  
  <p>The first 2 columns are inputs &amp; the 3rd will display the result of multiplying these inputs (for each row), the I would like the 3rd column in the final row to calculate the sum of the results in column 3. </p>
  
  <p>I am thinking I need to write a JavaScript function to iterate over the entire table but what I am unsure of is how to label the inputs - does each one need to be different?</p>
  
  <pre><code>&lt;table width="80%" border="0"&gt;
      &lt;tr&gt;
          &lt;th&gt;Column 1&lt;/th&gt;
          &lt;th&gt;Column 2&lt;/th&gt;
          &lt;th&gt;Result&lt;/th&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;input id="???" type="text" /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input id="???" type="text" onchange="calculate()" /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input id="result" /&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;input id="???" type="text" /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input id="???" type="text" onchange="calculate()" /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input id="result" /&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;input id="???" type="text" /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input id="???" type="text" onchange="calculate()" /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input id="result" /&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;input id="???" type="text" /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input id="???" type="text" onchange="calculate()" /&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input id="result" /&gt;&lt;/td&gt;
      &lt;/tr&gt;
  
  &lt;/table&gt;
  </code></pre>