title: Conditions does not match result
body: <p>I have a condition that identifies if 2 inputted values are equal or one is greater than the other. Sometimes it works and sometimes it displays a wrong result.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function identify() {
    var num1, num2;
  
    num1 = document.getElementById("num1").value;
    num2 = document.getElementById("num2").value;
  
    if (num1 == num2) {
      document.getElementById("answer").innerHTML = num1 + " and " + num2 + " are equal";
    } else if (num1 &gt; num2) {
      document.getElementById("answer").innerHTML = num1 + " is greater than " + num2;
    } else if (num2 &gt; num1) {
      document.getElementById("answer").innerHTML = num2 + " is greater than " + num1;
    }
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;h2&gt;Enter first number: &lt;/h2&gt;
  &lt;input type="number" id="num1" /&gt;
  
  &lt;h2&gt;Enter second number: &lt;/h2&gt;
  &lt;input type="number" id="num2" /&gt;
  
  &lt;button onclick="identify()"&gt;Identify&lt;/button&gt;
  
  &lt;p id="answer"&gt;&lt;/p&gt;</code></pre>
  </div>
  </div>
  </p>