title: jQuery.val() integer datatype comparison
body: <p>I am bit confused of this integer comparison using jQuery</p>
  
  <p>I have 2 input values. </p>
  
  <ul>
  <li>input type="number" class="highestBid" value=
  <li>input type="number" min="0" class=" bid" name="bid" id="bid"</li>
  </ul>
  
  <p>so basically the inputed bid from user in the 2nd input field must be always higher than the current highest bid. </p>
  
  <p>I used following jQuery code to compare between these 2 codes :</p>
  
  <pre><code>$(function(){
   $('.bid').focusout(function(){
    if($('.bid').val() &lt;= $('.highestBid').val()){
      $('.bidPlaced').prop('disabled', true);
    }
    else{
      $('.bidPlaced').prop('disabled', false);
      $('.buyItNow').prop('disabled', false)
    }
    });
  </code></pre>
  
  <p>});</p>
  
  <p>The code works fine, but just now there is a bug I figured out</p>
  
  <p>if the current highest bid is : $123
  and the user input : $21
  the function will not work</p>
  
  <p>but if the user key in $122, the code will work</p>
  
  <p>I found out that the jQuery code just compare the first value which in this case is $(1)23 to $(2)1.</p>
  
  <p>can anybody tell me what is wrong with the jQuery code? </p>
  
  <p>Thanks!</p>