title: How correctly compare two numbers with jQuery?
body: <p>I want to compare two int numbers, but the functions says always that the numbers are different. I've already tried with different comparison symbols (both == and ===) without success.</p>
  
  <p>What am I doing wrong?</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>$('.check').click(function() {
    var number1 = parseInt($('.number1').text());
    var number2 = parseInt($('.number2').text());
    var testPassed = $('.test').css('background-color','green');
    var testFailed = $('.test').css('background-color','red');
    var resultG = $('.result').html('It is the same number!');
    var resultNG = $('.result').html('The numbers are different!');
    
   if(number1 === number2) {
     testPassed;
      resultG;
    } else {
     testFailed;
      resultNG;
    }
  })</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.test {
    width: 50px;
    height: 50px;
    border: 1px solid black;
    border-radius: 50%;
    margin-top: 10px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;p class="number1"&gt;10&lt;/p&gt;
  &lt;p class="number2"&gt;10&lt;/p&gt;
  &lt;button class="check"&gt;Check&lt;/button&gt;
  &lt;div class="test"&gt;&lt;/div&gt;
  &lt;p class="result"&gt;&lt;/p&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>And what should I do to get a "true" result if I put -10 into <code>$('.number1')</code>? <br />
  Also if I use <code>Math.abs(number1)</code> to force it into a positive number nothing change and I get always a "false" result.</p>
  
  <p>I'm pretty sure I'm doing something wrong with the comparison itself.</p>