title: Function add(num1, num2) not working?
body: <p>I have a simple addition calculator Javascript code. It works entirely fine, but when I try using the <code>add(num1, num2)</code> function on two variables, rather than adding the two it simply prints them next to each other.</p>
  
  <p>For example, I type in 5 and 4
  It would print <code>54</code> in 'Answer'</p>
  
  <p>If I remove the part that gets the value from the inputs and replace them it with numbers, I can call <code>add(num1, num2)</code> and it works fine. For example, I can say <code>add(5, 3)</code> and the return would be <code>8</code>, just not working with variables.</p>
  
  <p>Here is the code</p>
  
  <pre><code>var back = 0;
  
  function add(num1, num2) {
      return num1 + num2;
  } 
  
  function functions() {
      if (back==0) 
      {
          var first = document.getElementById("number1").value;
          var second = document.getElementById("number2").value;
          var Addition = add(first, second);
          document.getElementById("number1").style.display = 'none';
          document.getElementById("number2").style.display = 'none';
          document.getElementById("Answer").style.display = 'block';
          document.getElementById("Answer").value = "Answer: " + Addition;
          document.getElementById("write").value = "Go Back";
          back = back+1;
      }
      else
      {
          document.getElementById("Answer").style.display = 'none';
          document.getElementById("number1").style.display = 'inline';
          document.getElementById("number2").style.display = 'inline';
          document.getElementById("write").value = "Add";
          back = 0;
      }
  }
  </code></pre>