title: Equality comparison against 0 not working
body: <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 compare() {
    var value1 = parseInt(document.getElementById("box3").value);
    var value2 = parseInt(document.getElementById("box4").value);
    var display = document.getElementById("box5");
    if (value1 === 0 || value2 === 0) {
      display.value = "You have entered zero";
    } else if (value1 == value2) {
      display.value = "The numbers are the same";
    } else if (value1 % value2 == 0) {
      display.value = "The first is divisible by the second";
    } else if (value2 % value1 == 0) {
      display.value = "The second is divisible by the first";
    } else {
      display.value = "They are not divisible";
    }
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;p&gt; Enter two numbers and we will tell you if they are evenly divisble&lt;/p&gt;
  &lt;p&gt; Enter your first number:&lt;/p&gt; &lt;input type="text" id="box3"&gt;
  &lt;p&gt; Enter your second number: &lt;/p&gt; &lt;input type="text" id="box4"&gt;
  &lt;button id="compareValue" onclick="compare()"&gt;Compare Values&lt;/button&gt;
  &lt;p&gt; Output will appear here: &lt;/p&gt; &lt;input text="type" id="box5" disabled&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>In the above code, enter 89.09 in the first number input and 0.05 into the second number input. Clicking on compare values returns</p>
  <blockquote>
  <p><strong>You have entered zero</strong></p>
  </blockquote>
  <p><a href="https://i.stack.imgur.com/XCoNc.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XCoNc.jpg" alt="Equality comparison against 0 not working" /></a></p>
  <p>The question is why?</p>