title: Stop key from repeating on hold. (jQuery)
body: <p>Hello everyone i just picked up jQuery</p>
  
  <p>So my question is i want to stop a key from repeating when you hold it down</p>
  
  <p>Example: Edit (i want it to stop .. so 1 character per keypress/keydown)</p>
  
  <p>keypress: a</p>
  
  <p>HoldDown: aaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
  
  <p>My code is:</p>
  
  <pre><code> &lt;input type='text'&gt;
  
  var stop= false;
  var time =null;
  $(':text').keypress(function(e) {
  if(stop === true){e.preventDefault();}
      if (time !== null) {
          lastkey = time;
      }
      time = new Date().getTime();
      var between = time - lastkey;
      if (between &lt;= 70) {
          stop = true;
      }
  });
  $(':text').keyup(function(){stop = false;});
  </code></pre>
  
  <p>Am i going about this the wrong way?</p>