title: Prevent backspace in input text box
body: <p>I'm making a Web application that tests typing speeds.</p>
  <p>It gives the user some text to type, and an input box to type into. If the user types a wrong key, I'm using <code>preventDefault</code> on the produced key event to prevent the wrong character from being entered into the input box (I instead show the user an error message).</p>
  <p>The problem is, <code>preventDefault</code> doesn't prevent backspaces from being entered. Ideally, since wrong keys presses will never be entered into the text box, it doesn't make sense to allow backspacing. If the user habitually hits backspace on a perceived error, it causes the text in the input box become incorrect. This doesn't affect the results of the test, it's just not an ideal situation.</p>
  <p>How can I prevent backspacing in HTML5 input elements of type &quot;text&quot;?</p>