title: calculating input fields by class name
body: <p>Here is my form:</p>
  
  <pre><code>&lt;INPUT TYPE=TEXT NAME="input1" SIZE=10&gt;
  &lt;INPUT TYPE=TEXT NAME="input2" SIZE=10&gt;
  &lt;INPUT TYPE="button" VALUE="+" name="add"
  onclick="CalculateIMSUB(this.form)"&gt;
  &lt;INPUT TYPE=TEXT NAME="Answer" SIZE=12&gt;
  </code></pre>
  
  <p>Here is my function:</p>
  
  <pre><code>function CalculateIMSUB(form) {
  var Atext = form.input1.value;
  var Btext = form.input2.value;
  var val = form.val.value;
  var A = eval(Atext);
  var B = eval(Btext);    
  var answer = A - B;
  form.Answer.value = answer;
  }
  </code></pre>
  
  <p>Here is my question:
  I want my function to operate through classname. So, if my form were to look like this instead:</p>
  
  <pre><code>&lt;INPUT TYPE=TEXT classNAME="input1" name="baboon" SIZE=10&gt;
  &lt;INPUT TYPE=TEXT classNAME="input2" name="gorilla" SIZE=10&gt;
  &lt;INPUT TYPE="button" VALUE="+" name="add"
  onclick="CalculateIMSUB(this.form)"&gt;
  &lt;INPUT TYPE=TEXT NAME="Answer" SIZE=12&gt;
  </code></pre>
  
  <p>The calculater function would still work.
  Many thanks</p>