title: Trigger a function with jQuery after a single letter was typed in an input box
body: <p>I'm trying to make a simple search box. How can I trigger a function just after a single letter was typed in an input box? I used .keyup, but this seems to be useless, because when a diacritic character is typed, the function is triggered three times.</p>
  
  <pre><code>&lt;input id="text" type="text" /&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;script&gt;
      $('#text').keyup(function(){
          $('div').append('TEST'+$(this).val());
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>The above code works fine unless you type any diacritic character: ą, ś, ł, ż, ź, ć, etc.</p>
  
  <p>I can't use .keypress or .keydown since they trigger a function before a character is typed.</p>
  
  <p>EDITED LATER:</p>
  
  <p>I know that my example might not be clear enough to understand the problem, but... In my real code every time a letter is typed, an SQLite query is executed. If a type a diacritic character or a capital letter, the query is executed three or two times, which slows down the whole script. It won't make a big difference if you execute the script in a computer web browser, but there is significant lag in mobile browsers.</p>