title: How to use keydown function correctly?
body: <p>Im using <code>keydown</code> for check if the input text value isn´t bigger than a value for example 10.</p>
  
  <p>Im doing this:</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;input id="number" type="text"&gt;
  </code></pre>
  
  <p>JQUERY</p>
  
  <pre><code>    $("#number").keydown (function(){
      var numberentered = $(this).val();
        if(numberentered &lt; 10){
          console.log("IT IS NOT BIGGER THAN 10");
        }else{
          console.log("IT IS BIGGER THAN 10");
        }
      });
  </code></pre>
  
  <p>If the number is <code>&lt; 10</code> all work, but when the number is for example in this case 11 it not work.</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>$("#number").keydown (function(){
      var numberentered = $(this).val();
        if(numberentered &lt; 10){
          console.log("IT IS NOT BIGGER THAN 10");
        }else{
          console.log("IT IS BIGGER THAN 10");
        }
      });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.0/jquery.min.js"&gt;&lt;/script&gt;
  &lt;input id="number" type="text"&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>If I change <code>keydown</code> for <code>keyup</code> it work but I want use <code>keydown</code> and know why it isn´t working.</p>
  
  <p>All help is welcome, greetings and thanks in advance!!</p>