title: How do I make document.getElementById('id').value return a number not a string in Javascript
body: <p>I am making a form for users to input number and then trying to display the sum.
  But the <code>document.getElementById('someid').value</code> is returning a string. And hence my add function is concatenating the strings instead of adding them as number. How do I solve it. Sorry for such a basic question.</p>
  
  <pre><code>//Script
  function add(){
  var a = document.getElementById('num1').value;
  var b = document.getElementById('num2').value;
  return a + b;
  }
  console.log(add());
  //HTML
  &lt;p&gt; Input 2 numbers to add&lt;/p&gt;
  &lt;input type="number" id="num1"/&gt;
  &lt;input type="number" id="num2"/&gt;
  &lt;input type="submit" value="Add" onclick="add()"&gt;
  </code></pre>