title: Building a typewriter generator that defines the font-wight depending on typing speed
body: <p>This is solved: <a href="https://codepen.io/danborjesson/pen/qGjMzw" rel="nofollow noreferrer">https://codepen.io/danborjesson/pen/qGjMzw</a></p>
  
  <p><strong>EDITED:</strong></p>
  
  <p>I'm building a text generator that will change the font weight depending on the speed you type. This <a href="https://codepen.io/danborjesson/pen/qGZGgG" rel="nofollow noreferrer">Codepen</a> showing what I have so far.</p>
  
  <p>It contains a function that starts a timer each time a key is pressed and a way to change the font's weight at the same action. However, not dependent on each other. </p>
  
  <p>Is it possible to get the value from this javascript:</p>
  
  <pre><code>    var last;
  var output = $('#output');
  $('#text').on('input', function() {
      var n = new Date()
      output.text((last - n) + ' ms');
      last = n;
  });
  </code></pre>
  
  <p>In to this, instead of 900, to simplify.</p>
  
  <pre><code>function myFunction(event) {
    document.getElementById("text").style.fontWeight = "900";
  }
  </code></pre>
  
  <p>I can't find a way! All help is appreciated!</p>
  
  <p>/R</p>