title: Javascript - Average calculation
body: <p>Hi I am trying to write a simple calculation that will average the two numbers entered by user input and then click the average button to get the average of the two.  MY problem is that it does not produce an answer. Here is the code</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;input type="text" id="one"&gt;
  &lt;input type="text" id="two"&gt;
  
  &lt;input type ="button" onclick="average()"value="average"&gt;
  &lt;input type="text" id ="avg"&gt;
  &lt;script type"text/javascript"&gt;&gt;
  function average(){
      var a=parseInt(document.getElementById("one".value);
      var b=parseInt(document.getElementById("two".value);
      var afinal=((a+b)/2);
          document.getElementById('avg').value=afinal;
      }
  &lt;/script&gt;   
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>