title: For Loop not working
body: <p>I want this function to add the two values inputted from the form but instead of adding the values it merges the number. If I input 2 and 2 it comes 22, whereas I want 4 to be outputted. I take it that the for loop is not wotking</p>
  
  <pre><code>&lt;script&gt;
  var calculate = function(){
  var input = document.getElementsByTagName("input");
  var length = input.length;
  for (var i = 0; i &lt; length; i++) {
    input[i] = input[i].value;
    input[i] = parseInt(input[i]);
  }
  var total_living_room = input[0] + input[1];
  document.getElementById("sh").innerHTML=total_living_room;
  }
  &lt;/script&gt;
  </code></pre>