title: jQuery : get values of text field when typing
body: <p>I want to get text field value while typing.</p>
  
  <pre><code>&lt;input type="text" name="noofppl"&gt;
  </code></pre>
  
  <p>I want to get its value while typing, so if someone types less than 20 I give an alert that the minimum number allowed is 20.</p>
  
  <p>Please help me with this.</p>
  
  <p>This is what I've tried: </p>
  
  <pre><code>$( "#people" ).focusout(function() {
    if($(this).val()&lt;20){
      alert("Minimum number of people should be  20"); 
    }
  });
  </code></pre>