title: Text is displayed with delay
body: <p>I want text I enter in a text field immediately to be shown in a div:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function func() {
    document.getElementById("query").innerHTML = document.getElementById("keyword").value;
  }
  window.onload = function() {
    keyword.onkeydown = function(e) {
      func();
    }
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;input type="text" id="keyword" size="40"&gt;
  &lt;div id="query"&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>It works, the only problem is, it is displayed with a delay.  </p>
  
  <p>So if I enter "abc", it only shows "ab". I need to enter another character, for example "abcd", so that it shows "abc".<br>
  The last character is always missing.</p>
  
  <p>Here you can try it out: <a href="http://jsfiddle.net/285cz0np/">http://jsfiddle.net/285cz0np/</a></p>