title: Keyup event handler shows slow performance
body: <p>My example:</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>$(document).on('keyup', '[contenteditable=true]', function (e) {
          
      let _this = $(this), text = _this.text();
  
      if (text.length === 1) {
          let span = $('&lt;span&gt;').text(text);
          _this.html(span);
      }
  
      console.log(_this.html());
  
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>[contenteditable=true] {
    border: 1px solid #ccc;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div contenteditable="true"&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>My problem: If I type some text (more than 1 character) with normal speed into the div, code works fine. But, when I try to type text with fast speed, no <code>&lt;span&gt;</code> tag was appended to the div.</p>
  
  <p>How can I fix that?</p>