Reading numbers from inputs with JavaScript always returns NaN
<p>I want to create a calculator which simply sums 2 fields up. But whatever I try it does not work. It also returns "NaN", also if I use parseInt().</p>

<p>Here's the code:</p>

<pre><code> &lt;script type="text/javascript" language="Javascript"&gt;
 function doSum() 
 {
 var a = document.getElementsByName("a").value;
 var b = document.getElementsByName("b").value;

 var sum =  a + b;

 document.getElementById("sum").value = sum;
}
&lt;/script&gt;

&lt;form action="" method="POST"&gt;
&lt;br/&gt;a:&lt;br/&gt;
&lt;input type="text" name="a" onblur='doSum()' value="0" size="5" /&gt;
&lt;br/&gt;b:&lt;br/&gt;
&lt;input type="text" name="b" onblur='doSum()' value="0" size="5" /&gt;
&lt;br/&gt;Ergebnis&lt;br/&gt;
&lt;input type="text" id='sum' value='' size="50" disabled/&gt;
&lt;/form&gt;
</code></pre>

<p>Sorry for that noob question, but what I'am doing wrong?
Thanks for any help!</p>
