Access HTML form values in javascript
<p>Here is what I am trying to achieve, but for some reason, it does not work:</p>

<p><strong>Javascript:</strong></p>

<pre><code>&lt;script type="text/javascript"&gt;         
  function  calculate() {             
     var n1 = getElementById("1").value
     var n2 = getElementById("2").value
     var answer = n1+n2
     alert(answer)
  }
&lt;/script&gt;
</code></pre>

<p><strong>HTML:</strong></p>

<pre><code>&lt;form id="form"&gt;
&lt;input id="1" type="text" /&gt;
&lt;input id="2" type="text" /&gt;
&lt;input type="button onClick="calculate()" value="Go" /&gt;
&lt;/form&gt;
</code></pre>

<p>I am not sure where I went wrong, Can someone help please?</p>
